0

Hello you all,

I have used label in repeater to display news content.see the code below.

<asp:Label ID="lblNewsContent" Width="1000px" Height="500px" runat="server" Text='<%#Eval("News_Content")%>' ReadOnly="true" BorderStyle="None" BorderColor="#EFF3FB" BackColor="#EFF3FB" TextMode="MultiLine"></asp:Label >

Now problem is that how can i give new line in label after certain amount of characters?means i have say 500 characters record i want break line or give new line after 50 characters.how can i achieve this?i m fetching news content from DB.

Give me some guidence.
Thank you all.

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by krunalkakadia
1

Hello you all,

I have used label in repeater to display news content.see the code below.

<asp:Label ID="lblNewsContent" Width="1000px" Height="500px" runat="server" Text='<%#Eval("News_Content")%>' ReadOnly="true" BorderStyle="None" BorderColor="#EFF3FB" BackColor="#EFF3FB" TextMode="MultiLine"></asp:Label >

Now problem is that how can i give new line in label after certain amount of characters?means i have say 500 characters record i want break line or give new line after 50 characters.how can i achieve this?i m fetching news content from DB.

Give me some guidence.
Thank you all.

hey are you sure Label has TextMode property ? I believe Lable doesn't have Multiple line functionality.
Instead you can use Text Box set it's Wrap and TextMode property and it will work for you.

Votes + Comments
pl reply me soon
0

oh sorry first i have used textbox but later used label so forgot to remove textmode.but my question is same?

<asp:Label ID="lblNewsContent" Width="1000px" Height="500px" runat="server" Text='<%#Eval("News_Content")%>' ReadOnly="true" BorderStyle="None" BorderColor="#EFF3FB" BackColor="#EFF3FB" >

please reply me.

0

oh sorry first i have used textbox but later used label so forgot to remove textmode.but my question is same?

<asp:Label ID="lblNewsContent" Width="1000px" Height="500px" runat="server" Text='<%#Eval("News_Content")%>' ReadOnly="true" BorderStyle="None" BorderColor="#EFF3FB" BackColor="#EFF3FB" >

please reply me.

no dude- you can't do such thing with Label. Instead i say use Text Box and with the help of style set Text Box such that it will look like label. :-)

0

i have used textbox with textmode =multiline earlier but i got scroll at right hand side which is not good looking as i have to only show the data.
ok if i use textbox according to you then how can i achieve solution for the same problem without scrolling in textbox?

pl reply

0

i have used textbox with textmode =multiline earlier but i got scroll at right hand side which is not good looking as i have to only show the data.
ok if i use textbox according to you then how can i achieve solution for the same problem without scrolling in textbox?

pl reply

Sorry for late replay...
you need to set either overflow:hidden; or overflow:auto; in style and then use this style in your text box.

it will work...

0

hi rohand,

i had applied ur css code and working properly, thanks dude.

now i want to give new line after fixed amount of characters(say after every 100characters) in that textbox as i had told u that i m displaying news content n large amount.

pl guide me for that.thanks waiting for ur reply.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.