Sometimes when entering the management page, when the session and cookies disappear, we have to return to the login page. After logging in, we still want to return to the page where we just managed the operation. This is very practical. Request.UrlReferrer can be implemented using an attribute of Request
Gets information about the last URL requested by the client, which linked to the current URL.
When a page jumps to this page, it will record the URL that jumps to this page, and then use this URL to return. Tips, write them down
1protected void Page_Load(object sender, EventArgs e)
2 {
3 ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
4
5 HyperLink1.NavigateUrl = (string)ViewState["UrlReferrer"];
6 Response.Write((string)ViewState["UrlReferrer"]);
7}
Source: Clingingboy