469,632 Members | 1,639 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,632 developers. It's quick & easy.

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 4774
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
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.