0
我用asp.net MVC 5.动作的方法是:错误:儿童动作不允许执行重定向动作
public ActionResult GetRSSFeed(string rssfeed, string xslt)
{
try
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load(rssfeed);
string returnhtml = ConvertXML(xDoc, Server.MapPath(xslt), new XsltArgumentList());
//InsertArticlesInDatabase(returnhtml);
return Content(returnhtml.
Replace(@"[[ This is a content summary only. Visit my website for full links, other content, and more! ]]",
""));
}
catch
{
return Content("");
}
}
在视图的代码:
Html.Action("GetRSSFeed", "RSSReader", new { rssfeed = Model.RssFeed.ToString(),xslt = Url.Content(Model.XsltTransformation.ToString()), area = "RSSReader" })
当例外是出现执行不在控制器中的代码。
我该如何解决这个错误,以及为什么会出现这个错误?控制器中的代码不会在任何地方重定向,它只是返回纯html。
可能重复[“子动作不允许执行重定向动作”](https://stackoverflow.com/questions/8924529/child-actions-are-not-allowed-to-执行重定向消息的动作) – jgauffin