ok...so far so good. thanks. i have another question. the first time the window that is spawned (through the call to showModalDialog), the Session.SessionID value (Page_Load and ispostback is false) is different from all subsequent reloads of that page. after the first Page_Load the sessionID value remains the same. This is important because on that first call I am caching a couple of datasets. These are lost on the next Page_Load because the Session object has changed. Any ideas as to how I can prevent the Session object from changing between the initial page load and all other reloads?
----- Ken Cox [Microsoft MVP] wrote: -----
Hi Patrick,
Do you really need to use an HTML button? A server-side button can be made
to do what you need quite nicely. You add the javascript to the onclick
attribute and return true. The page will refresh itself!
Here's a little demo that uses a label and a button. Notice how the time on
the label updates on the refresh. Grids would do about the same
refresh-wise.
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Label1.Text = Now.ToLongTimeString
Dim sb As New System.Text.StringBuilder
sb.Append("javascript:window.showModalDialog")
sb.Append("('
http://authors.aspalliance.com/kenc/',")
sb.Append(" '','');return true;")
Button1.Attributes.Add("onclick", sb.ToString)
End Sub
<form id="Form1" method="post" runat="server"><P><asp:Label id="Label1" runat="server">Label</asp:Label></P><P><asp:Button id="Button1" runat="server" Text="Pop"></asp:Button></P></form>
Ken