I have error handling set up in IIS 7 to forward to a 404 page, but the querystring does not ever appear to be passed over.
For example, this page does not exist so it directs to the 404 page:
www.mysite.com/nonexistingpage.aspx?id=1
On the 404 page, in the page_load, I cannot access id=1 because it doesn't seem like it's ever reaching the 404 page. So, trying to get it using these methods doesn't work:
Request.UrlReferrer.PathAndQuery
Request.ServerVariables["HTTP_REFERER"]
In IIS, my Path is entered as: /404.aspx and the Type is set to: Execute URL. How can I ensure the query string will be passed to the 404 page?
Edit: In Fiddler, the redirection is: /404.aspx?aspxerrorpath=/nonexistingpage.aspx, so this confirms it's definitely not being passed over.