Why does the newly added record appear on another page after a new record is added in ASP?

Source: Internet
Author: User

Recently, when I was working on an ASP project, I suddenly encountered a strange problem. After I added a new record to a page, the newly added record is always not displayed on its display record page, it must be refreshed before we can see that at first we thought it was a problem with cookies, but this problem still occurs when we delete cookies, so I checked the relevant records on the Internet for a long time and finally found someone asking such a question.
The original post is as follows:

For more information, see <G id = "1"> Add a record to access </G>. redirect ". ASP ". this ASP file is responsible for reading and displaying database records.
Now it is successful to add a record each time, but it cannot be displayed when the returned file a is returned. It must be re-entered once (equivalent to refresh ?) To display.
Thanks for your advice!
---------------------------------------------------------------

You don't need response. Redirect
Switch to: Response. Write "<script language = JavaScript> window. Location. href = 'a. asp '</SCRIPT>"
---------------------------------------------------------------
If not, add the parameter. Window. Location. href = 'a. asp? Temp =. 123456789"
---------------------------------------------------------------
Response. redirect is only a page Jump in the server. The target webpage can be a page in the server cache (if any). This is an ASP accelerated access method, however, this method causes the target page to be cached.
Response. Write "<script language = JavaScript> window. Location. href = 'a. asp '</SCRIPT>"
This is an action statement that is passed to the client for page Jump. The client sends a page Jump request to the server, this request is the same as the request sent by entering a new address in your browser. This request is initiated to the server's response, which forces the server to re-run the ASP Webpage. Of course, this result shows the newly added content.

Of course, the way Brighteye (always asking) transmits a random parameter to an ASP Webpage is to avoid the server's cache webpage because the webpage receives a different parameter, that is to say, it is re-reading rather than caching pages. Csdn adopts this method. After each problem is opened, there is a temp = in the address bar. 234567 (random number), the random number is generally not repeated, so that each time you open the ASP page, the parameters passed in are different from the page to achieve the goal.

after reading the page, I suddenly realized that I should convert the statements on the page to Windows. location = "XXX. ASP "finally solved the problem, relieved. Although it was only a small problem, I still felt very happy after the solution, so I am sending this article right away. If you have any friends with similar problems, I hope to help you.

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.