Handling events triggered by dynamically created controls

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
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.
 
use a hidden field or viewstate to store the number of controls, and any
other info you need.

-- bruce (sqlwork.com)
 
Back
Top