Handling events triggered by dynamically created controls

N

Nathan Sokalski

I have a series of LinkButtons that I need to be able to handle the postback
events for. The controls are created dynamically, and how many there will be
will vary. I was previously told to create them in the Page's Init event and
to make sure the same ID is used. Here are the problems I am having with
that:

1. In the Init event I do not know how many I need to create.

2. How do I know what the ID's were?

Any help would be appreciated (and if you know of any sites with good
examples that would definitely be nice). Thanks.
 
B

bruce barker

use a hidden field or viewstate to store the number of controls, and any
other info you need.

-- bruce (sqlwork.com)
 

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,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top