I can access the querystring variable on a GET request, but not a POST

sujathak

New Member
If I try and access a webpage that has a filter that checks for authentication, it redirects to the login page when I am surfing anonymous. So the URL may look like:\[code\]www.example.com/user/login?ReturnUrl=/user/settings\[/code\]My Login action has 2 methods, when for GET and one for POST request types.\[code\][AcceptVerbs("GET")public ActionResult Login(){}[AcceptVerbs("POST")public ActionResult Login(FormCollection f){}\[/code\]The following code is in both the GET and POST login action:\[code\] string redirectUrl = ""; if(Request.QueryString["ReturnUrl"] != null) { redirectUrl = Request.QueryString["ReturnUrl"]; }\[/code\]When in debug mode, the variable is initialized properly in the GET action, but in the POST action it just skips the call, which means it is NULL.Why is this? The ReturnUrl is still visible in the url?
 
Top