window. showModalDialog double load problem clear cache method

  • 2020-06-23 00:11:07
  • OfStack

One such thing happened today.
 
var frmHeight = 352; 
var frmWidth = 508; 
var frmTop = (window.screen.height - frmHeight) / 2; 
var frmLeft = (window.screen.width - frmWidth / 2); 
var url = "ChosePerson.aspx"; 
var parameter = "dialogHeight:" + frmHeight + "px;dialogWidth:" + frmWidth + "px;dialogTop" + frmTop + "px;dialogLeft" + frmLeft + "px;scroll:0;status:0;reziable:1;"; 
var rval = window.showModalDialog(url, "", parameter); 
window.showModalDialog()// The first 1 The secondary load is going page_load() Of the method 2 It doesn't go when it's second loaded page_load(); 

Specific reasons:
The first time you open the window, the second time the browser does not fetch the data from the server, but directly finds the file you have downloaded.

Final solution:
1. Set browser properties
Change IE Settings to 1 and try again. Internet -> regular -> Settings -> check each time you visit this page
(Advantage full station reload, can solve the problem)

2. Add cache to clear the previous cache
// Join the cache to clear the previous data and prevent the page from not loading
< %@ OutputCache Duration="1" VaryByParam="none"% >
(Advantages are only for the required interface, saving time)
/ / new

3.(7/10 test found that IE7 does not support the second cache format) There is no way but to modify the cache clearing code
in < head > < /head > add
< META HTTP-EQUIV="Pragma" CONTENT="no-cache" >
< META HTTP-EQUIV="Cache-Control" CONTENT="no-cache" >
< META HTTP-EQUIV="Expires" CONTENT="0" >

Related articles: