Jul 05, 2019 06:42 AM|Brando ZWZ|LINK
What is the difference between below statements . When i use first one sometimes message is not displayed
According to your description, I have created a test demo on my side. It works well.
I guess this is related with the exception message, I suggest you could set a breakpoint to the ex message to let us know details ex message.
More details about my test demo, you could refer to below codes:
public partial class ResponsAlert : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
Exception ex = new Exception("test");
Response.Write("<script>alert('" + ex.Message.Replace("\'", " ") + "')</script>");
Response.Write("<script>alert('" + ex.Message + "');</script>");