473,322 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

multiline label control in the datalist

26
Hello,kindly request you to plz help me.....
I have label control in the datalist.I want to display the text in this label with line breaks....Plz help me......Thks in advance.
Feb 25 '09 #1
6 4074
@Ria12
You can do by loop. at the first you have to check length on rowdatabound event then show in label
Feb 28 '09 #2
Frinavale
9,735 Expert Mod 8TB
HTML <br /> will add a new line.
So when you're adding text to the label, be sure to add a "<br />" when ever you want a new line.
Mar 2 '09 #3
Ria12
26
Thks for your replies..
But i want to make it clear , i cannot insert line breaks in HTML coz i am binding the data from database....Can you plz explain me the loop that i have to write in row data bound....?
Mar 3 '09 #4
Refer this link


http://forums.asp.net/t/1375350.aspx
Mar 3 '09 #5
Ria12
26
Thks for sending this link ......I got the answer !!!
Mar 3 '09 #6
Try This

<asp:Label ID="CommentLabel" runat="server" Text='<%# Eval("Comment").ToString().Replace(Environment.New Line, "<br />") %>' />
Sep 20 '13 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Dude | last post by:
Below is the code - it is finding the control, and there is no error, just not assigning the text to the label <asp:DataList id="dlGoals" runat="server" onEditCommand="myListEditHandler"...
9
by: jjack100 | last post by:
I want to set the text value of a label that is within a datalist in the codebehind. Does this have to be done in the databound event? Simplified example: <asp:DataList id="dlItem"...
1
by: Jameel | last post by:
Hi Coders, How do i Add a Lable control to DataList to show the Count Files which belong the current Category. i have a DataList which displays categoryName,Description and File counter...
1
by: | last post by:
I have a label control that I've embedded in a datalist template. I will be binding data to that label. I want to run a string formatting function on the database text before it is injected into...
7
by: rn5a | last post by:
How can I place a Label control in the FooterTemplate of a DataList control? I tried this <script runat="server"> Sub Page_Load(obj As Object, ea As EventArgs) Dim dblTotal As Double Dim...
2
by: rn5a | last post by:
Consider the following code: <script runat="server"> Sub ShowData(obj As Object, ea As EventArgs) lblDate.Text = DateTime.Now.ToString("d") lblDate.DataBind() End Sub </script> <form...
1
by: Steve Hershoff | last post by:
I'm using VS 2003, and need to extract the text from an asp label in my code-behind file. The label is part of a DataList's ItemTemplate. I've noticed that in my ascx file (we're using User...
0
by: rn5a | last post by:
One of the columns in a SQL Server 2005 DB table is named 'OrderDate' which stores the date & time on which an order has been placed. Since the 'OrderDate' of a particular order will be the same, I...
0
by: lamarant | last post by:
OK...I have a datalist that, in each row, has control and a label. What I want to happen is for the text in the label to update when its associated control is clicked. Here's what I have so...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.