Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP.NET / VB: Newlines inside code

Posted on 2012-03-24
6
Medium Priority
?
379 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 672 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 664 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 664 total points
ID: 37762461
use one of the following: VbNewLine, VbCrLf and <br />
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

886 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