Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/259.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 错误:不允许子操作执行重定向操作_C#_Asp.net Mvc - Fatal编程技术网

C# 错误:不允许子操作执行重定向操作

C# 错误:不允许子操作执行重定向操作,c#,asp.net-mvc,C#,Asp.net Mvc,我用的是asp.NETMVC5。行动方法是: public ActionResult GetRSSFeed(string rssfeed, string xslt) { try { XmlDocument xDoc = new XmlDocument(); xDoc.Load(rssfeed); string returnhtml = ConvertXML(xDoc, Server.MapPath(xslt), new XsltA

我用的是asp.NETMVC5。行动方法是:

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。

看起来是这样的重复:

mea发生过几次这种情况,因为我在控制器上有[RequireHttps],并且从另一个控制器调用了一个子操作。RequireHttps属性导致重定向

的可能重复