ASP.NET clear mode window data cache operation

  • 2020-06-01 09:31:33
  • OfStack

The use mode window showModalDialog () pop-up page is often used in
The most used is to click the "modify" button, popup modify page; After successful modification, close the modification page and refresh the parent page.
At present, there is a problem: after refreshing the parent page, click the modify button to pop up the modified page, but the data displayed on the modified page is not the modified data, or the old data on the modified page pops up for the first time. Here, the problem of clearing the cached data in the mode window is involved.
This involves the ShowModalDialog caching mechanism, which requires us to manually add some code to clear the cache.

The operation mode is as follows:
First, in the foreground interface (aspx interface) code, add: < meta http-equiv="expires" content="0" / > < %-- used to clear the cache, the value of expires is assigned to the background page Page_Load function --% >
Then in the background interface (that is, the cx interface), Page_Load function, if (! IsPostBack) {... }, add the code: Response.Expires = -1; // is used to clear the cache
In this way, the cached data in the mode window can be cleared, haha

Related articles: