All,
I am using an HTML control in my asp.net app.I run this as a server control and programatically access this from my code behind(C#) class.Plase see the markup.
. The innerHTML property is set dynamically from code.My issue is if the InnerHTML is really long , i set line breaks at specific char intervals. That looks ok except for the horizontal line that appears between the text.
I need to display text like this
-----------This is my name
blah blahhhhhh------------------
but right now it displays as
--------This is my name---------------
blah blah blah
Is there a way to set the line programaticcaly or using style?
thanks for help
You can do a few things :
set the width of your control so the text inside wraps automatically to the next line
Edit the content of the control, inserting line breaks where needed
There’s no method to automatically transform text as your example shows. It is possible, but you might need to write it yourself.
A warning here : you can measure the letters easily with
"string".Lengthbut it gives no guarantee to the actual width, in pixels, of the string (consider"iii"takes less room than"www"in non-fixed width fonts). If you want to measure pixels, it gets complicated fast, so your better off measuring the number of letters.