Solved

ASP.NET / VB: Newlines inside code

Posted on 2012-03-24
6
341 Views
Last Modified: 2012-03-25
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
Comment
Question by:hankknight
6 Comments
 
LVL 5

Expert Comment

by:Rainverse
ID: 37761941
Just a simple <br> should do it.
0
 
LVL 16

Author Comment

by:hankknight
ID: 37762008
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
 
LVL 5

Expert Comment

by:Rainverse
ID: 37762057
VbCrLf
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 168 total points
ID: 37762201
'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
 
LVL 10

Assisted Solution

by:himanshut
himanshut earned 166 total points
ID: 37762275
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
 
LVL 17

Accepted Solution

by:
nepaluz earned 166 total points
ID: 37762461
use one of the following: VbNewLine, VbCrLf and <br />
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What .NET URL re-routing tool did I use? 2 37
Error in JQuery 5 39
I need help making a collection from a class in VB.Net 3 26
Need a starter for ETL protocol? 4 42
As most anyone who uses or has come across them can attest to, regular expressions (regex) are a complicated bit of magic. Packed so succinctly within their cryptic syntax lies a great deal of power. It's not the "take over the world" kind of power,…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now