M
Mel
I ALWAYS struggle with these, sorry. Can anyone help me? My parent
window has some server side vb code to open the Modal popup window.
My modal popup window appears and I want to do some server-side
processing before returning to the parent window. I also need to pass
one value back. How to accomplish this? Here is what I have so
far...
Here is my parent window code:
'image button exists on parent window. Clicking the button
displays the modal dialog (called notes).
Protected Sub imgNote_Click(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs)
Dim windowAttribs As String
Dim lngWidth As Long = 1440, lngHeight As Long = 900
Dim imageButton As ImageButton = sender
Dim tableCell As TableCell = imageButton.Parent
Dim row As GridViewRow = tableCell.Parent
windowAttribs = "dialogwidth=" & lngWidth & "px;" & _
"dialogheight=" & lngHeight & "px;" & _
"Edge: Raised; center: Yes;help: No; resizable: Yes;
status: No"
'use a modal dialog - pass FAB NUM and TASK ID
ScriptManager.RegisterStartupScript(Me, GetType(String),
"OpenWindowScript", "window.showModalDialog('Notes.aspx?p1=" &
txtFabNum.Text.ToString & "&p2=" & row.RowIndex + 1 & "','','" +
windowAttribs + "');", True)
End Sub
'this is my popup window OK button
Protected Sub cmdOK_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdOK.Click
'server side processing is done here (which writes the notes
to the database).
Session("Notes") = txtNote.Text.ToString 'this is the data I
want to pass back to parent window
'THIS CODE DOES NOT WORK. HOW DO I CLOSE A MODAL DIALOG?
Dim strscript As String = "<script
language=javascript>window.close();</script>"
If (Not ClientScript.IsStartupScriptRegistered
("clientScript")) Then
ClientScript.RegisterStartupScript(Page.GetType(),
"clientScript", strscript)
End If
End Sub
window has some server side vb code to open the Modal popup window.
My modal popup window appears and I want to do some server-side
processing before returning to the parent window. I also need to pass
one value back. How to accomplish this? Here is what I have so
far...
Here is my parent window code:
'image button exists on parent window. Clicking the button
displays the modal dialog (called notes).
Protected Sub imgNote_Click(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs)
Dim windowAttribs As String
Dim lngWidth As Long = 1440, lngHeight As Long = 900
Dim imageButton As ImageButton = sender
Dim tableCell As TableCell = imageButton.Parent
Dim row As GridViewRow = tableCell.Parent
windowAttribs = "dialogwidth=" & lngWidth & "px;" & _
"dialogheight=" & lngHeight & "px;" & _
"Edge: Raised; center: Yes;help: No; resizable: Yes;
status: No"
'use a modal dialog - pass FAB NUM and TASK ID
ScriptManager.RegisterStartupScript(Me, GetType(String),
"OpenWindowScript", "window.showModalDialog('Notes.aspx?p1=" &
txtFabNum.Text.ToString & "&p2=" & row.RowIndex + 1 & "','','" +
windowAttribs + "');", True)
End Sub
'this is my popup window OK button
Protected Sub cmdOK_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdOK.Click
'server side processing is done here (which writes the notes
to the database).
Session("Notes") = txtNote.Text.ToString 'this is the data I
want to pass back to parent window
'THIS CODE DOES NOT WORK. HOW DO I CLOSE A MODAL DIALOG?
Dim strscript As String = "<script
language=javascript>window.close();</script>"
If (Not ClientScript.IsStartupScriptRegistered
("clientScript")) Then
ClientScript.RegisterStartupScript(Page.GetType(),
"clientScript", strscript)
End If
End Sub