Solved

New line in a ASP.NET label

Posted on 2009-06-29
7
827 Views
Last Modified: 2012-05-07
Hello,
I have one ASP.NET web form, which contain a label to display a warning message.
The label is implemented as :

label.Text = "some warning text here" & variable & "text continue here" & ...

I want that the  "text continue here"  will be displayed on a second line in the same label:

 "some warning text here" & variable
 "text continue here" & ...

Can i do this without using another label, thanks,
i am using VB.
0
Comment
Question by:Nyana22
7 Comments
 
LVL 2

Expert Comment

by:Jambyte
ID: 24740029
try:

label.Text = "some warning text here" & variable & vbcrlf & "text continue here"

or maybe you can use an html table that will word wrap the label in a table column?
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24740048
You can use
label.Text = "some warning text here" & variable & vbNewLine & "text continue here"
 
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 24740050
Opps! To slow :)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Nyana22
ID: 24740064
vbcrlf
didn't work
0
 

Author Comment

by:Nyana22
ID: 24740073
even vbNewLine didnt work!
0
 
LVL 23

Accepted Solution

by:
Snarf0001 earned 500 total points
ID: 24740160
since asp.net, just insert (br /), but pretend those are angled brackets (don't haveon my phone)
0
 

Author Closing Comment

by:Nyana22
ID: 31598112
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access/Visual Basic Question 3 42
Where does legacy ASP.NET initialize language? 2 59
Filtering a datagrid view 8 34
VB.NET System.NullReferenceException 1 19
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

756 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