ASP. NET Clear mode window data cache Operation Method

Source: Internet
Author: User

The use mode window showmodaldialog () pop-up page is frequently used in Asp.net
You can click "modify" to bring up the modification page. After the modification is successful, close the modification page and refresh the parent page.
A problem currently exists: After refreshing the parent page, click Modify to bring up the modification page. The data displayed on the modification page is not the modified data, this is the first time that the old data on the modification page is displayed. Here, the cache data in the clear mode window is involved.
This involves the showmodaldialog cache mechanism. We need to manually add some CodeTo clear the cache.

The procedure is as follows::
First, in the front-end interface (aspx Interface) code, add: <meta http-equiv = "expires" content = "0"/> <% -- used to clear the cache, the expires value is assigned to the page_load function on the background page -- %>
Then in the background interface (CX Interface), In the page_load function, if (! Ispostback ){...} In addition, add code: Response. expires =-1; // used to clear the cache
In this way, the cache data in the mode window can be cleared, haha

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.