How to call Jscript or VBscript function in sub ?

T

THY

Hi,

I need to know how can I call JavaScript or VBscript function from a sub ...
so I can display a pop-up when a sub is executed ...

thanks
 
K

Kevin Spencer

You can't display a client-side popup when a server-side Sub is executed.
However, you CAN add a client-side script to the page which will execute
when the page reaches the browser. Use Page.RegisterStartupScript to do it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
The more I learn, the less I know.
 
T

THY

not that clear about Page.RegisterStartupScript ... do you have any short
example for this ?
 
S

S. Justin Gengo

THY,

I have an example that is similar on my website, www.aboutfortunate.com. You
can make the <body> tag of the page into a server control and then add the
popup code to that. You can find the example easily by going to the code
library on the site and searching for: "body tag as server control" or
something similar.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top