Hey all, i have a label on my page displaying data from my database. I set the width to 666px, because that is my centered form. I want the text to wrap if it goes past that, but it's not. especially if someone types something like "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa". Any suggestions to make this work?
Heh... i think the forum answered my own question... add a horizontal scroll? :-D
What seemed to be the problem with this listing in particular is someone pasted from MS word into my FreeTextBox control... totally screwed up my formatting.
The question doesn't have to do with the label control, it has to do with HTML. Your browser wouldn't know where to put a break on a continuous string of characters so it doesn't. When you're validating the input, maybe you could force a break (by inserting a "-" for instance) after so many characters without a natural break (i.e. space, "-").
hi buddy.
If you type a sentance then u can write word wrap but in ur Question it is one word which will not be so long.. one way is that you can count the word and split it. then it may work write your own function else
public static string WrappableText(string source)
{
string nwln = Environment.NewLine;
return "<p>" +
source.Replace(nwln + nwln , "</p><p>")
.Replace(nwln, "<br />") + "</p>";
} use this
Or you could use a TextBox as ReadOnly. Make it multiline, choose the number of rows you want to break the long text into, make BorderStyle = None and BorderWidth = 0px.
0 comments:
Post a Comment