Disable page cache in Asp.net 2.0 to solve the problem of page refresh (reload data!

Source: Internet
Author: User

Generally, web pages have a temporary file in the Temporary Internet folder.
This problem occurs when I operate ie:
Suppose there is a page Treeview. aspx, after my first visit, it will have a Treeview in my temporary Internet folder. aspx file generation. then, if I change the Treeview. after accessing the data of aspx, I found that IE did not view the Treeview. the data of aspx is updated, but the page that I accessed for the first time is displayed. this is because IE automatically (by default) calls a Treeview in the Temporary Internet folder. aspx, file, instead of downloading the new Treeview. aspx,
How can I enable IE to automatically download the new Treeview. aspx, Just Like clicking the refresh button to reload the page?

One way is to set Internet Options.
Internet Options --> General --> "Settings" in Temporary Internet Files --> check every time you access this page.
In this setting, it is best to delete temporary files at the same time.
This method allows the customer to set their own browsers. If the customer forgets the settings, the new page will never be downloaded locally. What does the customer think? ("Certainly yesProgramError! "In fact, it is not a program error, but it can be completely solved by the Program)

Method 2: Use a program to automatically download the page.
In this way, the page is not saved to the Temporary Internet folder. Every time you access the page, the browser downloads the page.
In Treeview. aspx,CodeAdd the page_load event

Context. response. cache. setcacheability (httpcacheability. nocache );

You can.

If you do not add this sentence, you can open the page and there will be a page file in the Temporary Internet folder.
However, if an image or JS file exists in An ASPX file, it will still be downloaded to a temporary Internet folder.

2007-08

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.