Accessing values of dynamically added controls on Postback

G

Guest

Hi,

I have added some textbox dynamically and now trying to retrieve the values
posted on a 'save' event.

when I try the following lines I get 'Object reference not set to an
instance of an object.....'

foreach(Control c in Parent.Controls) <--- line where I'm getting this
{
Response.Write ("<BR>" + c.GetType().ToString());
}

Any help?????
 
E

Eliyahu Goldin

You have to re-create dynamically created controls on every postback.

Eliyahu
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top