Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.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# ASP.NET未分析查询字符串_C#_Asp.net_Query String - Fatal编程技术网

C# ASP.NET未分析查询字符串

C# ASP.NET未分析查询字符串,c#,asp.net,query-string,C#,Asp.net,Query String,我正在开发一个web应用程序,而不是使用会员资格,而是直接使用FormsAuthentication 问题是,当我执行表单post时,我能够获取所有字段,但它没有解析查询字符串 在调试器中查找时,查询字符串位于URI中,但不在QueryString数组中 我正在尝试从查询字符串中获取ReturnUrl,以便使登录页面转到正确的位置。您不需要解析该QueryString;请尝试在登录页面中调用: if(Request.Params["ReturnUrl"] != null) { Forms

我正在开发一个web应用程序,而不是使用会员资格,而是直接使用FormsAuthentication

问题是,当我执行表单post时,我能够获取所有字段,但它没有解析查询字符串

在调试器中查找时,查询字符串位于URI中,但不在QueryString数组中


我正在尝试从查询字符串中获取ReturnUrl,以便使登录页面转到正确的位置。

您不需要解析该
QueryString
;请尝试在登录页面中调用:

if(Request.Params["ReturnUrl"] != null)
{
    FormsAuthentication.RedirectFromLoginPage(userName, createPersistentCookie);
}

我遇到的问题是查询字符串没有显示在QueryString[]中,因此请求.Params[“ReturnUrl”]对我不起作用。你不能调用FormsAuthentication.RedirectFromLoginPage吗?