Groups | Blog | Home
all groups > asp.net webcontrols > february 2008 >

asp.net webcontrols : Handling events triggered by dynamically created controls


bruce barker
2/27/2008 3:05:01 PM
use a hidden field or viewstate to store the number of controls, and any
other info you need.

-- bruce (sqlwork.com)


[quoted text, click to view]
Nathan Sokalski
2/27/2008 5:52:28 PM
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.
--
Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

AddThis Social Bookmark Button