get responce from another server in mvc
In my mvc applicat开发者_如何转开发ion i need to responce or return view value from another server.
Like calling from one MVC application in a server to another mvc application in a server.
You could get the response from a server using a WebClient and return it as text:
public ActionResult MyAction()
{
using (var client = new WebClient())
{
string response = client.DownloadString("http://otherserver/controller/action");
return Content(response, "text/html");
}
}
精彩评论