Hi,
I am trying to call a JavaScript function from my ascx control code behind in the catch block. I have tried the below two ways but they don't seem to work.
Page.ClientScript.RegisterClientScriptBlock(typeof(string), "script", "test();", true);
ScriptManager.RegisterStartupScript(Page, GetType(), "err_msg", "alert('error');", true);
The function is called if I place the code Under "PageLoad" but doesn't get called when placed in catch block.Should I do any different to call a JavaScript function from catch block. Please suggest.
Thanks