tags:

views:

95

answers:

1

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)';
A: 

Wow. 6 whole hours and not a single person could have pointed out that I had an apostrophe in the wrong place? For shame. Leaving this here to mark as answer later.

Chris

related questions