Hi Alfons,
Thanks for posting in the community! My name is Steven, and I'll be
assisting you on this issue.
From your description, when you loaded a page again(second time) using
"window.showModalDialog" javascript code, the page(be opened) seemed not be
newly loaded(page's server Load event was not fired)
However, when you change the IE's page "check for new version always" as
true, it worked, yes?
If there is anything I misunderstood, please feel free to let me know.
I've done some tests on my side and did encountered the same problem. I've
also tried Steve's suggestion that set the page's client cache attribute
via:
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
Yes, this did work. So the problem is due to the client cache. The page
popuped be the "showModalDialog" may be cached by default. You may also try
Steve's solution to see whether it works for you.
In addition, here is the test page I used to test Steve' suggestion, you
may have a look as reference if you have anything unclear:
------------------------------first page's aspx
file--------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>PopUp</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="
http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
var hNew
function PopUp()
{
var dt = new Date();
divMessage.innerText = dt.getMilliseconds();
hNew = window.showModalDialog("Refresh.aspx");
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table width="500" align="center">
<tr>
<td><div id="divMessage"></div>
</td>
</tr>
<tr>
<td><INPUT id="btnShow" type="button" value="ShowPage"
onclick="PopUp()"></td>
</tr>
</table>
</form>
</body>
</HTML>
---------------------------the poped up page's aspx page
file-------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Refresh</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="
http://schemas.microsoft.com/intellisense/ie5">
<base target=_self>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table width="500" align="center">
<tr>
<td>
<asp:Label id="lblMessage" runat="server"></asp:Label>
</td>
<td>
<asp:Button ID="btnPost" Text="Post Back" Runat="server"></asp:Button>
</td>
</tr>
</table>
</form>
</body>
</HTML>
------------------------------the poped up page's code behind page
class----------------------
public class Refresh : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button btnPost;
protected System.Web.UI.WebControls.Label lblMessage;
private void Page_Load(object sender, System.EventArgs e)
{
lblMessage.Text = "Load at: " + DateTime.Now.ToLongTimeString();
Response.Expires = 0;
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
Please check out the suggestion. If you have any further questions, please
feel free to post here.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)