This is not working:
try
{
EnvironmentVerifier.VerifyAppFoldersAndFiles();
}
catch (Exception ex)
{
ClientScript.RegisterStartupScript(GetType(), "Error!", "alert('" + ex.Message + "');", true);
Logger.LogError(ex.Source, ex.TargetSite.ToString(), ex.Message);
return;
}
When the error occurs, it goes into the catch block but the alert message is not showing up. Am I missing anything?
Try this:
The .Replace(“‘”, @”\'”) escapes your alert(‘message’); because if you have an error message like this:
it will break unless you do this: