I need to pass a value to javascript from code behind.
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "<script type='text/javascript'>OpenPopUp();</script>", false);
JS:
function OpenPopUp(parameterValue) {
paramframe = parameterValue;
openmodal(paramframe);
}
So parameterValue
will have ID.Text value which is passed from code behind.
I need to pass a value from code behind in this function OpenPopUp
to javascript.
I tried below code and the javascript doesn't fire. Am I passing the value correct to JS.
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "<script type='text/javascript'>OpenPopUp(" + ID.Text + ");</script>", false);
ID.Text
is a ItemTemplate value of a LinkButton in a gridview.