c# - I can access the querystring variable on a GET request, but not a POST -
If I try to use a webpage that contains a filter that checks for authentication, then I'm surfing I'm redirecting to the login page during anonymity. Then the URL looks like this:
www.example.com/user/login?ReturnUrl=/user/settings
There are 2 ways in my login process, When for GET and for a POST request type. The following codes are both GET and POST login actions Has: In debug mode, the variable is initialized properly in GET action, but in POST action it leaves the call, which means that it is zero. Why is this? Is the return URL still visible in the URL?
string redirectUrl = ""; If (Request.QueryString ["ReturnUrl"]! = Null) {redirectUrl = Request.QueryString ["ReturnUrl"]; }
Combining query string parameters with one post, technically RFC-compliant, make one or the other Should, but not both. (After saying that I have not come into a browser / web-server that does not allow this.)
If you want to "correctly" it then you have ReturnUrl as a secret input to retrieve fields on the form and other form variables on the server.
Comments
Post a Comment