Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

ASP.NET / VB: Newlines inside code

When using ASP.NET / VB, how can I add new lines in the following?

This gives an error:

<p>
<%=AutoFormat("Hello Line 1
Line 2
Line3
Line 4")%>
</p>

Open in new window

0
hankknight
Asked:
hankknight
3 Solutions
 
RainverseCommented:
Just a simple <br> should do it.
0
 
hankknightAuthor Commented:
No, I am looking for a newline, not HTML!  In Linux I can do this by using \n however that does not seem to work here.
0
 
RainverseCommented:
VbCrLf
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Dave BaldwinFixer of ProblemsCommented:
'VbCrLf' would be the correct answer... except that <p></p> are HTML tags where <br> is the correct answer.  What are you trying to do?
0
 
himanshutCommented:
You may be looking for System.Environment.NewLine

Refer this: http://msdn.microsoft.com/en-us/library/system.environment.newline.aspx

By adding System.Environment.NewLine, it would act as <br> but in code behind for c# or vb.net

Cheers
0
 
nepaluzCommented:
use one of the following: VbNewLine, VbCrLf and <br />
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now