Dynamic add labels to a form.

S

Stephen Russell

I have this in code:
Label myLabel1 = new Label();

myLabel1.Text ="Pick the Row you need changed in the Database";

myLabel1.Enabled = true;

myLabel1.Visible =true;



I don't see the lable on my webform. How do I referesh() the page like a
post_back?


--
Stephen Russell
S.R. & Associates
Memphis TN

901.246-0159
 
S

Stephen Russell

How do I do that dynamically? I have a page that needs a few things added
and by selection different stuff happens.

Thanks for the quick response!

__Stephen
 
S

S. Justin Gengo

Stephen,

If you're going to be dynamically loading different controls onto your page
you could take a look at a bit of sample code I have on my website,
www.aboutfortunate.com. Just search the code library for: "Create dynamic
controls" or something similar.

The sample code I provide specifically adds text boxes to the form. The
trick to the code is recreating the controls on post back in order to be
able to access their values.

You would be able to add a label control the same way I'm adding the text
boxes. You just wouldn't need to recreate them on post back.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

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
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top