472,119 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

how to call java script function after executived the server side code

hi:
i have a button, when i click it
i want to store data to database and open a new
window

in general we use java script to open new window
but how to call java script function after i
executived the server side code

thank you!
Nov 18 '05 #1
2 4851
One easy solution is to insert it into the response stream at the
appropriate line in the code behind
[snip]
Response.Write("<script>alert('hello,world')</script>");

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Cheng Wei-Chao" <um*****@mis.yuntech.edu.tw> wrote in message
news:03****************************@phx.gbl...
hi:
i have a button, when i click it
i want to store data to database and open a new
window

in general we use java script to open new window
but how to call java script function after i
executived the server side code

thank you!

Nov 18 '05 #2
Try the following and build on it

string script = "<script language='javascript'>\n
script += "alert('hey there');\n"
script += "</script>"

RegisterStartupScript("StartUp",script)
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by StealthMonkey | last post: by
15 posts views Thread by chirs | last post: by
1 post views Thread by Mike Moore | last post: by
4 posts views Thread by Bonato Pierantonio | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.