Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh parent page from pop-up window button click 2

Status
Not open for further replies.

clanm

Programmer
Dec 26, 2005
237
US
I only want to refresh the parent page if the user clicks a certain button on my pop-up window.

For that button, I have the following code on the button click event, but it's not working:

Dim scriptString As String = "<script language=JavaScript> "
scriptString &= "window.opener.document.forms(0).submit(); </script>"
If Not Page.IsClientScriptBlockRegistered(scriptString) Then
Page.RegisterClientScriptBlock("script", scriptString)
End If

Any suggestions are appreciated! Should I try Parent.Refresh() in the button click event?

Thanks!
 
jbenson001!

Thanks a ton! That was it:
.forms[0].submit use [] insted of ()
 
great!! glad you got it.. It's easy to mix up the syntax between javascript and vb...
If you use IE, there is a little icon on the left side of the status bar. You can click it, and it will tell you the error. that is about the only way to find if there is an error.

 
I find using IE the hardest method to find javascript errors as it doesn't seem to always point to the correct error. The methods I use are either:

1) The FireFox javascript console (which lists every error and is more informative)
2) Debug the javascript in Visual Studio (

____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Thanks to both of you!

Yeah, the IE icon in the lower left corner can be helpful, but I do like FireFox's version too. The VS one has helped me several times as well!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top