Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

calling javascript from server side

Tags:

c#

asp.net

How to call javascript function from server side

like image 668
Niraj Choubey Avatar asked Jul 29 '26 23:07

Niraj Choubey


1 Answers

You can simply do a Response.Write("<script language='javascript'>nameOfJavascriptFunction();</script>"), or use ClientScriptManager.RegisterClientScriptBlock with a similar script.

The effect is that you are outputting a script tag calling your function - the call is still done on the client side.

like image 162
Oded Avatar answered Aug 01 '26 11:08

Oded



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!