private void MethodRegisterJavaScript()
{
int a = 5; int b = 6;
StringBuilder script = new StringBuilder();
script.Append(“”);
Page.ClientScript.RegisterClientScriptBlock(typeof(object), ”JavaScriptBlock”, script.ToString());
}
In the above method I am passing parameters a, b to JavaScript function DisplayMessage.
RegisterStartupScript method registers the Script block at the bottom of page just before the closing form tag.
RegisterClientScriptBlock will be registered on the page before any of the control loads.
{
int a = 5; int b = 6;
StringBuilder script = new StringBuilder();
script.Append(“”);
Page.ClientScript.RegisterClientScriptBlock(typeof(object), ”JavaScriptBlock”, script.ToString());
}
In the above method I am passing parameters a, b to JavaScript function DisplayMessage.
RegisterStartupScript method registers the Script block at the bottom of page just before the closing form tag.
RegisterClientScriptBlock will be registered on the page before any of the control loads.
No comments:
Post a Comment