Possible Duplicate:
Get previous page URL after Response.Redirect
Suppose in page 1.aspx, if error occurs, I’m using in catch() block:
Response.Redirect("err.aspx");
In code behind of err.aspx, I need url of 1.aspx (or any page from which I’m redirecting to err.aspx page). How do I achieve this?
It is Page.Request.UrlReferrer; also you can add it as the redirect query parameter, or put into the session, if the referrer doesnt work somehow. see Get previous page URL after Response.Redirect