GoodMorningSky
Junior Member
 
122 Posts |
Posted - 11 January 2006 : 21:55:13
|
In ASP.NET aspx page, I use following code.
private void ibtnAddNew_Click(object sender, System.Web.UI.ImageClickEventArgs e) { try{ // Do something } catch(Exception ex) { Response.Write("<script>alert(\""+ ex.Message +"\");</script>"); return; } }
Problem occurs ex.Message contains New Line character or other invalid characters such as ", ' or others..
Is there any method I can call and make sure string being passed alert doesn't throw javascript error when I show the message to user?
Any idea helps. |
Software Engineer. MCSD.NET, SCWCD |
|