2015-09-22 57 views
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。

+0

可能重复[“子动作不允许执行重定向动作”](https://stackoverflow.com/questions/8924529/child-actions-are-not-allowed-to-执行重定向消息的动作) – jgauffin

回答

0

看起来是这样一个重复: Look here

这发生在MEA几次,因为我有[RequireHttps]在控制器和一个孩子的行动从不同的控制器调用。 RequireHttps属性导致重定向

相关问题