Handling events triggered by dynamically created controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nathan Sokalski

    Handling events triggered by dynamically created controls

    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@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。



  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Handling events triggered by dynamically created controls

    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
    njsokalski@hotm ail.com
    有声小说网为广大读者提供热门小说在线免费阅读,本站收集的网络文学小说情节跌宕起伏,有声小说网是值得书友们收藏的小说在线阅读网。

    >
    >
    >

    Comment

    Working...