This post will be having Samples,Code snippets, etc
To start with, external javascript reference ,
Page.RegisterClientScriptBlock(string key, string script);
This peace of code register a client side JavaScript block with "Script Key" (If this is already registered then previous f.js file will be replaced) and script -- external file that is referenced.
if(Page.IsClientScriptBlockRegistered(string key))
this peace of code checks if script block is registered or not.
after that JavaScript fucntion can be called from the C# code, some what like this.
button1.Attributes.Add("onClick", "javascript:return function name();");
0 comments
Post a Comment