I need to access additional querystring parameters from the ReturnUrl querystring.
The entire site requires authentication so all pages will redirect to the login page if the user is not logged in or has timed out. So www.mysite.com/Default.aspx?id=H1234 will redirct to www.mysite.com/login.aspx?ReturnUrl=%2fDefault.aspx%3fid%3dH1234 and if the user then enters their credentials they will be returned to Default.aspx passing the id, but I need to check the id on the login page as well.
On the login page I can Server.UrlDecode(Request.RawUrl) to: /login.aspx?ReturnUrl=/Default.aspx?id=H1234 but as this has 2 question marks I now cannot access Request.QueryString("id")
I could use substring methods to extract the value but that worries me as the id is not a fixed length and it seems insecure.
There doesn't seem to be much on Google (or at least I'm not asking the right question)