I am using a p tag with id p1.
<p id="p1" runat="server" ></p>
I have a message which I am passing from server side which is stored in variable "message".
This is first line
This is second line
I am passing this value to the p tag by
p1.InnerText=message.
My question is, How to add new line in the p tag from server side as shown above?
I have tried
but it is not working :
"This is firstline"+"<br/>"+"This is second line"
You can use
Environment.NewLinebetween strings.For example
Update 1:
You can use it like :-
If it not work than please try :-
Update 2:
With
<pre>you need to use"\n"instead ofEnvironment.NewLine