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

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
 
M

Mike Casey

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top