I have a user control that has an update panel inside it. When the form posts back, this event handler is fired:
protected void SubmitButton_Click(object sender, EventArgs e)
{
Page.Validate("ContactUs");
if (Page.IsValid)
{
ScriptManager.RegisterStartupScript(
SubmitButton, SubmitButton.GetType(),
"closeModal", "alert('test)';", true);
}
}
In the response, I can see the script is emitted, but it never runs. I get no error, the script just doesn't run. Any idea why?
The relevant output from the response that shows the script being emitted is:
14|scriptStartupBlock|ScriptContentNoTags|alert('test)';