User Control Example wanted!

  • Thread starter Thread starter Duncan Welch
  • Start date Start date
D

Duncan Welch

Does anyone know where I can find some example code of a user control that
contains dynamnically created text boxes of which the value can be retrieved
once the page has been submitted?

I think it's the OnInit process that I'm stuck on.

Thanks in advance,

Dunc
 
I've created the control fine, it displays fine. The ID and the value are
set correctly. The only thing I can't do is read what value the user has
entered in any textboxes, etc after they've submitted the page that has my
user control built dynamically on.

Dunc
 
Duncan Welch said:
I've created the control fine, it displays fine. The ID and the value are
set correctly. The only thing I can't do is read what value the user has
entered in any textboxes, etc after they've submitted the page that has my
user control built dynamically on.

Make sure to recreate your dynamic controls during page_load
before reading the user input, because you can't read values
out of controls that are not there anymore.
Also make sure to use the same ID's again.

When you don't really need the controls again after postback,
still create them, but make them invisible.
 
Back
Top