Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Handling events triggered by dynamically created controls

Reply
Thread Tools

Handling events triggered by dynamically created controls

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      02-27-2008
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

http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      02-27-2008
use a hidden field or viewstate to store the number of controls, and any
other info you need.

-- bruce (sqlwork.com)


"Nathan Sokalski" wrote:

> 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
>
> http://www.nathansokalski.com/
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
Handling events triggered by dynamically created controls Nathan Sokalski ASP .Net Web Controls 1 02-27-2008 11:05 PM
Managing ViewState of a dynamically created Custom Composite Server Control -(where the original is also dynamically created) dickster ASP .Net Building Controls 0 12-08-2005 09:32 AM
Handling Events for Dynamically Created Controls Nathan Sokalski ASP .Net Web Controls 2 05-23-2005 12:03 PM
Handling Events for Dynamically Created Controls Nathan Sokalski ASP .Net 2 05-23-2005 12:03 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57