简体   繁体   中英

Consume action from different website in ASP MVC controller

I have an ASP MVC controller with action PersonDetails which takes Person object as its parameter. The action is invoked via AJAX call, does some work to validate the Person model and returns a view.

What I'd like to achieve is to validate the model in this action and set some additional params, but then send the object to a different web application (also ASP MVC one) which would make further processing, generate a view and return it as a string. Person model is shared between two apps. Let's assume that I cannot use Web API or WCF instead of the second MVC controller from external app.

Is such scenario possible? What is the best approach when I need to consume action which resides in a different web application from MVC controller, and there is no restful API to use.

也许您不需要从第二个Web应用程序中调用Action,也许此“进一步处理”功能可以封装在一个公共项目中,那么您只需在第一个Web应用程序中引用该公共项目即可完成您想做的进一步处理

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM