Do I use a table for this?

  • Thread starter Thread starter Muppet
  • Start date Start date
M

Muppet

I have a database backend, VB.Net asp.net project, and I want to write a
memo field to a suitable control on a web form so that it will properly
display the carriage returns.

What control do I use for this?

I know how to do this with a textbox, but I don't want to use a textbox
because I don't want to see the scrollbar.

Basically, I want one big "area" that sizes to fit the text that is used.

So if I have a memo field with 5000 characters, the web page should be
longer than one with 1000 chars.

Do I use a table with one cell and a 0 pt border? How do I do this? I see
this all the time on websites so there must be something simple I am
missing.

Thanks for any pointers. New to asp.net but managed to get a basic site up
and running with some good advice on the newsgroups.
 
If you are using web controls, use the Label control and set it's
..Text property to the value in question. You may need to replace
carriage return characters with <br> tags.
 
Ok, sounds good. A couple of related questions..

How do I add <br> tags to a label?
In VB, I use the syntax: Label1.Text = str
How do I convert that?

Also, does the label control automatically resize based on the amount of
text I put in it? Will it ever creep off screen to the right? If so, how do
I stop it?
 
Ok, now I see. Just replacing the vbLf with <br> does it. Cool! Forgot this
is a web control.

As for my other question, do I simply create the max width I think I'll ever
need and be done with it?
 
If my memory serves me correctly, the LABEL web control actually ends
up being a <span> tag in HTML, which is really just a placeholder that
allows you to put some style or class options on it. In essence, you
can just forget about the tag's existence in the flow of HTML.

Dan
 
Perfect. Thanks.

Dan Brussee said:
If my memory serves me correctly, the LABEL web control actually ends
up being a <span> tag in HTML, which is really just a placeholder that
allows you to put some style or class options on it. In essence, you
can just forget about the tag's existence in the flow of HTML.

Dan
 
Back
Top