I have two controllers Base and Login.
Base Controller:
public ActionResult start()
{
string action = Request.QueryString[WSFederationConstants.Parameters.Action];
}
Login Controller:
public ActionResult Login(string user,string password,string returnUrl)
{
if (FormsAuthentication.Authenticate(user, password))
{
if (string.IsNullOrEmpty(returnUrl) && Request.UrlReferrer != null)
returnUrl = Server.UrlEncode(Request.UrlReferrer.PathAndQuery);
return RedirectToAction("Start","Base", returnUrl });
}
return View();
}
After authentication is done it gets redirected to Start action in Base Controller as expected. But the querystring doesnot fetch the value. When hovered over the querystring it shows length value but not the uri.
How to use the url sent from Login controller in Base Controller and fetch parameters from it?
WSFederationConstants.Parameters.Action. And it needs to bereturn RedirectToAction("Start","Base", new { returnUrl = returnUrl });if the value of that constant is"returnUrl"(your gettinglength=9because there are 9 characters in "returnUrl")returnUrl, why are you not just redirecting to it usingreturn RedirectToLocal(returnUrl);- what is yourstart()method for?