ASP response button code

Source: Internet
Author: User

When using ASP for network programming, the "back to previous page" button is often used. Although the browser has the return function, it is necessary to set the return button to facilitate visitors. The method is simple. Add the following code where you need to add the return button:

<A href = "<% = request. servervariables (" http_referer ") %>"> return </a>

 

Note: What does referrer mean?

Referrer is the source page address, for example, you from the http://www.abc.com/1.htm "point a link to http://www.xyz.com/somepage.aspx, then for the later, the Referer is the http://www.abc.com/1.htm ".

1. Sometimes the document cannot be obtained using the above second red code. referrer. Obviously this is because of document. referrer may also contain "&", so I use JavaScript to encode urlcode before passing it to the server segment.
2. We need to get the search engine keyword in the URL, but a website like Google uses UTF-8 encoding for the keyword. If you get it using the request object in ASP, the result may be garbled. My solution is to first decode it using the decodeuricomponent function of JavaScript, and then pass it to the server.

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.