RegisterStartupScript not working inside catch block
<p>I am <code>ASP.NET/C#</code>.In one of my pages where I am submitting customer information to the database I am using popup to notify the user if data was inserted, or when the form has not been filled correctly and I am also trying to show popup if something goes wrong while trying to insert.So far the popup displays correctly when data is inserted successfully and also when validation fails.But the popup doesnot display if something goes wrong while submitting.
Here is my code</p>

<pre><code>catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(GetType(), "UnexpectedError", "ShowSubmitPopUp('uerror')", true);
                NewCustomerStatusMsg.Style["display"] = "block";
                NewCustomerStatusMsg.Style["color"] = "Red";
                NewCustomerStatusMsg.Text = "There was some error while submitting your information.Please re-enter the values and try again.";
           }
</code></pre>

<p>Can anybody help me out with this.What is missing here.</p>

<p>Any suggestions are welcome.</p>
