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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top