Showing posts with label javascript server invoke. Show all posts
Showing posts with label javascript server invoke. Show all posts

Wednesday, June 24, 2009

Calling javascript from code behind

Previously, we know how to easily call server side method from javascript. The opposite is also simple enough.

Just use the RegisterClientScriptBlock method of ClientScriptManager (in case of full postback) or ScirptManager (in case of patial postback). Following is an example:

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "confirmInPageNav", "<script>confirmInPageNav()</script>", false);



confirmInPageNav can be any javascript function