Model view controller mvc-将xml发布到另一个站点(并重定向到该站点)
我正在使用MVC2和.NET3.5 我有两个mvc站点 如何将xml消息从站点1中的操作/页面发布到站点2中的页面? 同时将用户从站点1重定向到站点2中的页面Model view controller mvc-将xml发布到另一个站点(并重定向到该站点),model-view-controller,http,asp.net-mvc-2,Model View Controller,Http,Asp.net Mvc 2,我正在使用MVC2和.NET3.5 我有两个mvc站点 如何将xml消息从站点1中的操作/页面发布到站点2中的页面? 同时将用户从站点1重定向到站点2中的页面 非常感谢最简单的方法可能是修改站点2并添加控制器操作,该操作将接受应用程序/x-www-form-urlencoded请求(又称简单表单帖子): x、 XmlData)%%> 在新创建的操作(作为入口点)的站点2中,您可以将XML作为字符串获取并处理它: [HttpPost] [ValidateInput(false)] // <
非常感谢最简单的方法可能是修改站点2并添加控制器操作,该操作将接受
应用程序/x-www-form-urlencoded
请求(又称简单表单帖子):
x、 XmlData)%%>
在新创建的操作(作为入口点)的站点2中,您可以将XML作为字符串获取并处理它:
[HttpPost]
[ValidateInput(false)] // <-- that's necessary as we are POSTing XML
public ActionResult Index(string xmlData)
{
// Do something with the posted XML, and redirect or directly render a view
}
[HttpPost]
[ValidateInput(false)]//很抱歉回复延迟。
[HttpPost]
[ValidateInput(false)] // <-- that's necessary as we are POSTing XML
public ActionResult Index(string xmlData)
{
// Do something with the posted XML, and redirect or directly render a view
}