This Script is used for Load JavaScript through code behind
<
div
id
=
"uxDiv_ScriptBlock"
runat
=
"server"
style
=
"display:none;"
>
<
script
type
=
"text/javascript"
>
function test() {
alert("here");
}
</
script
>
</
div
>
protected void Page_Load(object sender, EventArgs e)
{
//register script
String script = uxDiv_ScriptBlock.InnerText.Replace(Environment.NewLine, "");
ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Scripts", script, false);
}
Link
No comments:
Post a Comment