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

  • Thread starter Thread starter Cheng Wei-Chao
  • Start date Start date
C

Cheng Wei-Chao

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!
 
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>");
 
Try the following and build on it

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

RegisterStartupScript("StartUp",script)
 
Back
Top