By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,939 Members | 1,638 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,939 IT Pros & Developers. It's quick & easy.

sending JavaScript code from server control to client ???

P: n/a
How can I send a javascript code from an asp server control to client
and run that script on client
for example;
when an asp server button clicked, an alert javascript must be sent to
client and run on the client
how can I do that?

please send an example if possible,

thank you very much!
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Response.Write()

If you have something like that though this will not execute until the page
is completly renedered to the client. There is no way to "pause and wait"
for something from the client, WWW is not designed this way.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Oney" <oz*********@yahoo.com> wrote in message
news:cc**************************@posting.google.c om...
How can I send a javascript code from an asp server control to client
and run that script on client
for example;
when an asp server button clicked, an alert javascript must be sent to
client and run on the client
how can I do that?

please send an example if possible,

thank you very much!

Nov 18 '05 #2

P: n/a
string s = "<script type=\"text/javascript\">alert(\"This is an
alert!\");</script>";
if (!(Page.IsStartupScriptRegistered("AlertScript")))
Page.RegisterStartupScript("AlertScript", s);

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Oney" <oz*********@yahoo.com> wrote in message
news:cc**************************@posting.google.c om...
How can I send a javascript code from an asp server control to client
and run that script on client
for example;
when an asp server button clicked, an alert javascript must be sent to
client and run on the client
how can I do that?

please send an example if possible,

thank you very much!

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.