2015-09-22 56 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屬性導致重定向

相關問題