M
Mike P
I am trying to build up some text in a stringbuilder and then use
javascript to show it with an alert box.
Here is my attempt to show it in an alert box :
string str = "";
str += "<script language='javascript'>";
str += "alert('" + sb + "')";
str += "</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), key,
str);
This works fine until I start trying to add /n's to my stringbuilder to
force new lines. When I do this I get the error 'unterminated string
constant'.
Can anybody help?
javascript to show it with an alert box.
Here is my attempt to show it in an alert box :
string str = "";
str += "<script language='javascript'>";
str += "alert('" + sb + "')";
str += "</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), key,
str);
This works fine until I start trying to add /n's to my stringbuilder to
force new lines. When I do this I get the error 'unterminated string
constant'.
Can anybody help?