Thursday, November 1

How to call javascript function in code behind

Introduction:-

                  
                    Here I have explained how to call a javascript function from code behind and a simple javascript alert message from code behind in asp.net.
 

Description:-

 Here I will explain how to show a alert message from code behind as well as javascript function call from code behind in asp.net application.


For call a javascript function from code behind write the following code.
 ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "CallPopUp();", true);

 

For a alert message from code behind write the following code
 
 ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", "alert(‘Hi this is shibashish’);", true);
 
I hope you will like this article. Any concern you can mail me or contact me by any social media.
 
Keep coding…
 
Thanks  Shibashish Mohanty
 

No comments:

Post a Comment

Please don't spam, spam comments is not allowed here.

.

ShibashishMnty
shibashish mohanty