Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/268.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# 如何将参数传递给returnURL MVC_C#_Model View Controller_Returnurl - Fatal编程技术网

C# 如何将参数传递给returnURL MVC

C# 如何将参数传递给returnURL MVC,c#,model-view-controller,returnurl,C#,Model View Controller,Returnurl,问题: 客户单击“Book”链接并重定向到登录页面 @Html.ActionLink("Book", "BookVisit", new { time = Model.availableTimesList[i].TimeOfDay, date = Model.dateOfAppointment, providerID = Model.providerID }) 登录后,我希望他被重定向到他最初想要的页面。我在自定义授权属性中使用此代码: protected override void Han

问题: 客户单击“Book”链接并重定向到登录页面

 @Html.ActionLink("Book", "BookVisit", new { time = Model.availableTimesList[i].TimeOfDay, date = Model.dateOfAppointment, providerID = Model.providerID }) 
登录后,我希望他被重定向到他最初想要的页面。我在自定义授权属性中使用此代码:

protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
{
     filterContext.Result = new System.Web.Mvc.RedirectResult("/UserAccount/LogIn/?ReturnUrl=" + filterContext.HttpContext.Request.Url.AbsolutePath+ "?" + filterContext.HttpContext.Request.QueryString);
}
但对于这种方法:

[AuthorizeUser(AccessLevel = "User,Admin")]
public ActionResult BookVisit(DateTime time, DateTime date,int providerID)

只获取第一个参数。为什么以及如何传递所有这些信息?

重定向URL是什么样子的?使用浏览器的网络监视器,重定向请求是什么样子的?我已经发现了一个额外的
。检查您正在构建的重定向URL。