Calling javascript from asp.net/vb.net code ??

  • Thread starter Thread starter Poppy
  • Start date Start date
P

Poppy

I have an asp.net page with a form on it.

After the user submits the form the form is then processed on the server.
If variouse conditions are met I then display a message saying "Thank
you...blah, blah. You will be rediredted in a moment"

I need to redirect the users to another page after 5 seconds. This will
need to be done in Javascript but using javascript in an asp.net page
confuses me a bit.

How can I achieve this ?

TIA
 
Don't remember where I got this code, but I've had luck
with it. This could be placed in the event handler for a
button control, for instance, and calls out JavaScript
code to open a popup window. Just replace your script
within the quotes....good luck.

Dim popupScript As String = "<script
language='javascript'>" & _
"window.open('aboutus.htm', 'AboutUs', "
& _
"'width=400, height=350, menubar=yes,
resizable=yes')" & _
"</script>"

Page.RegisterStartupScript("PopupScript",
popupScript)
 
Back
Top