0

Problem: Customer click 'Book' link and is redirected to the LogIn page.

 @Html.ActionLink("Book", "BookVisit", new { time = Model.availableTimesList[i].TimeOfDay, date = Model.dateOfAppointment, providerID = Model.providerID }) 

After loging in I would like him to be redirected to the page where he originally wanted to get. I use this code in custom Authorize Attribute:

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);
}

but to this method:

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

get only first parameter. Why and how to pass all of them?

Valentin
  • 5,380
  • 2
  • 24
  • 38
Zet
  • 571
  • 3
  • 13
  • 31
  • What does that redirect URL look like? Using the browser's network monitor what does that redirect request look like? – Jasen Feb 27 '16 at 19:58
  • I already spot an extra `?`. Check the redirect URL you are constructing. – Jasen Feb 27 '16 at 20:01

0 Answers0