G
Guest
From server-side code I'm using Response.Write to display a javascript alert
box. It works fine except when I try to include a new line character, which
causes this javascript error:
"Unterminated string constant"
Here's my c# code:
strText = "Line 1 text\nLine2 text";
Response.Write("<script>alert('" + strText + "');</script>");
Any ideas how to get around this problem?
box. It works fine except when I try to include a new line character, which
causes this javascript error:
"Unterminated string constant"
Here's my c# code:
strText = "Line 1 text\nLine2 text";
Response.Write("<script>alert('" + strText + "');</script>");
Any ideas how to get around this problem?