I have a javascript box popping up with some message in it but I have not found how to add line breaks from code behind and I am asked to make it to do so, here is how it currently works:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key",
"function SendBox() {location.href = 'movetopage.aspx';}
if(confirm('Move the items:" + myListOfItems + ". Do you want to continue? ') == true)
{SendBox();};", true);
That shows ok on the page, but now I need to add the following line
"Clicking OK: Moves the items and continues"
So the end bos should show like this
Move the items: Books, Magazines, Newspapers. Do you want to continue?
Cliking OK: Moves the items and continues.
Notice the break between the first line and second line?, I am not sure how to add that into the box given the code I provided for the Page.ClientScript… etc..
How can I add that break line there to the pop up box?
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key",
"function SendBox() {location.href = 'movetopage.aspx';}
if(confirm('Move the items:" + myListOfItems + ". Do you want to continue?
<BR>
Clicking OK: Moves the items and continues') == true)
{SendBox();};", true);
I tried adding a break
but would not work (makes sense) but i have exhausted options.
Use
\ninsted of<br/>becuase it’s not htmt, for your condition you should use\\nbecause in c#\should be escape