Below is the code snippet I am working with -
int p = 0;
try
{
p = System.Convert.ToInt16(txt7.Text);
}
catch
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "showMyMessage", "ShowMessage('Value must be numerical');", true);
}
Additionally, here is the function -
<script>
function ShowMessage(message) { alert(message); }
</script>
Even though the code enters the catch block during debugging, the expected pop-up is not appearing on the front end. Can you help me identify what I might be overlooking?