asp.net automatically returns the last Request page

Source: Internet
Author: User
Tags return
Asp.net| Request | page

Sometimes when I go to the admin page, the session and the cookie disappear, we want to return to the login page, and we still want to return to the page where we just managed the operation after login. This is a very important aspect. You can implement request.urlreferrer with one of the attributes of the request
Gets information about the URL that was last requested by the client, which is linked to the current URL.

When a page jumps to this page, it records the URL that jumps to the page and then returns using the URL. Little tricks, record them.

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}



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.