Do I use a table for this?

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.
 
D

Dan Brussee

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.
 
M

Muppet

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?
 
M

Muppet

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?
 
D

Dan Brussee

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
 
M

Muppet

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top