first way is
System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "document.getElementById('" + button2.ClientID + "').style.display='none';", true); |
| System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "MyJavascriptFunction();", true); |
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
Subscribe by RSS
Subscribe by Email
|
|||
|
|
Subscribe by RSS
Subscribe by Email
7 comments :
Hi..
Your site is really nice.i learned many things from this site.Please try to write the above article with some examples.This could be useful for the beginners like me.
1. RegisterClientScriptBlock
2.RegisterClientScriptInclude
3.RegisterStartupScript
4. RegisterOnSubmitStatement
I had a problem with typeof(Page) so I resorted to the following with success:
System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "Script", "function();", true);
worked for me...
Thank You a lot...
Its Not Working...........
yes its not working .....
we can call the alert from this method but call a function is not working ...!
how to call code behind fuction from javascript????