S
Steve Wark
I have created a ASP.NET application and created two forms within the
application (Webform1.aspx & Webform2.aspx). On the first form I have
placed a textbox (TextBox1) and a button, which when clicked opens the
second form using the window.open(). On the second form I have a textbox
(TextBox1) and a button as well. When the second button is clicked it
closes the second window with window.close(). What I need to happen is a
refresh to happen on the original form so that the value passed back from
the second window is displayed in the textbox.
Webform1 Button Click Event
Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles LinkButton1.Click
Dim popupScript As String = "<script language='javascript'>" &
"window.open('webform2.aspx', 'CustomPopUp', " & "'width=600, height=400,
menubar=no, resizable=no, top=200, left=200')" & "</script>"
Page.RegisterStartupScript("PopupScript", popupScript)
End Sub
Webform2 Button Click Event
Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles LinkButton1.Click
Dim popupScript As String = "<script language='javascript'>" &
"window.opener.document.forms(0).value=" & Chr(34) & TextBox1.Text & Chr(34)
& ";window.close();window.opener.location.href =
window.opener.location.href" & "</script>"
Page.RegisterStartupScript("PopupScript", popupScript)
End Sub
I have tried various options but none seem to work. Can anyone advise?
Cheers
Steve
application (Webform1.aspx & Webform2.aspx). On the first form I have
placed a textbox (TextBox1) and a button, which when clicked opens the
second form using the window.open(). On the second form I have a textbox
(TextBox1) and a button as well. When the second button is clicked it
closes the second window with window.close(). What I need to happen is a
refresh to happen on the original form so that the value passed back from
the second window is displayed in the textbox.
Webform1 Button Click Event
Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles LinkButton1.Click
Dim popupScript As String = "<script language='javascript'>" &
"window.open('webform2.aspx', 'CustomPopUp', " & "'width=600, height=400,
menubar=no, resizable=no, top=200, left=200')" & "</script>"
Page.RegisterStartupScript("PopupScript", popupScript)
End Sub
Webform2 Button Click Event
Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles LinkButton1.Click
Dim popupScript As String = "<script language='javascript'>" &
"window.opener.document.forms(0).value=" & Chr(34) & TextBox1.Text & Chr(34)
& ";window.close();window.opener.location.href =
window.opener.location.href" & "</script>"
Page.RegisterStartupScript("PopupScript", popupScript)
End Sub
I have tried various options but none seem to work. Can anyone advise?
Cheers
Steve