Dynamic add labels to a form.

  • Thread starter Thread starter Stephen Russell
  • Start date Start date
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
 
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
 
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
 
Back
Top