M
Marc Robitaille
Hello,
I have a server button on my page. This button is use to open a serach page.
In the Page_Load event, I code this
If (Not Page.IsClientScriptBlockRegistered("clientScript")) Then
Page.RegisterClientScriptBlock("clientScript",
mpstrGetOpenSearchDialogScript)
End If
If Not IsPostBack Then
cmdSearch.Attributes.Add("onclick", "OpenSearchDialog();")
End If
Private Function mpstrGetOpenSearchDialogScript() As String
Dim strScript As String = ""
strScript += "<script language=""javascript"">" + Environment.NewLine
strScript += " function OpenSearchDialog()" + Environment.NewLine
strScript += " {" + Environment.NewLine
strScript += " var winSettings = 'center:yes;resizable:no;help:no;'" +
Environment.NewLine
strScript += " + 'status:no;dialogWidth:960px;dialogHeight:495px';" +
Environment.NewLine
strScript += " window.showModalDialog('frmSearch.aspx', '',
winSettings);" + Environment.NewLine
strScript += " }" + Environment.NewLine
strScript += "</script>" + Environment.NewLine
Return strScript
End Function
This code open a dialog window and it works perfectly. My problem is that I
need to set Session variables before the window opens. The server click
event of my button execute afther the window is close by the user. Is it
possible to set my session variables before the window is open when I click
on my search button?
Thank you!
Marc R
I have a server button on my page. This button is use to open a serach page.
In the Page_Load event, I code this
If (Not Page.IsClientScriptBlockRegistered("clientScript")) Then
Page.RegisterClientScriptBlock("clientScript",
mpstrGetOpenSearchDialogScript)
End If
If Not IsPostBack Then
cmdSearch.Attributes.Add("onclick", "OpenSearchDialog();")
End If
Private Function mpstrGetOpenSearchDialogScript() As String
Dim strScript As String = ""
strScript += "<script language=""javascript"">" + Environment.NewLine
strScript += " function OpenSearchDialog()" + Environment.NewLine
strScript += " {" + Environment.NewLine
strScript += " var winSettings = 'center:yes;resizable:no;help:no;'" +
Environment.NewLine
strScript += " + 'status:no;dialogWidth:960px;dialogHeight:495px';" +
Environment.NewLine
strScript += " window.showModalDialog('frmSearch.aspx', '',
winSettings);" + Environment.NewLine
strScript += " }" + Environment.NewLine
strScript += "</script>" + Environment.NewLine
Return strScript
End Function
This code open a dialog window and it works perfectly. My problem is that I
need to set Session variables before the window opens. The server click
event of my button execute afther the window is close by the user. Is it
possible to set my session variables before the window is open when I click
on my search button?
Thank you!
Marc R