Dynamic controls and event wiring

Discussion in 'ASP .Net' started by =?Utf-8?B?SG9tYW0=?=, Feb 16, 2005.

  1. To wire a Click event handler to a dynamically-added control (e.g.
    LinkButton), you need to do so during the Load event of the parent (e.g. a
    PlaceHolder).

    The problem is, the Click event handler sets up a member variable that needs
    to control how the dymanic controls are created in the first place!

    Alas, I can't do so because it's already too late since the Load event fires
    before the Click event.

    Wiring the Click event handler during the PreRender event of the parent
    doesn't work.

    I played around with the idea of using positional static controls and
    dynamically setting their Visible and Enabled properties, but it turned out
    quite messy.

    Is there a way to work around this problem.

    I appreciate your feedback.
     
    =?Utf-8?B?SG9tYW0=?=, Feb 16, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oisin Grehan
    Replies:
    3
    Views:
    490
    Natty Gur
    Jul 15, 2003
  2. =?Utf-8?B?amVzc2UgamFtZXMgMjAyMA==?=

    Custom Web Control - viewstate and event wiring questions

    =?Utf-8?B?amVzc2UgamFtZXMgMjAyMA==?=, Aug 18, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    414
    =?Utf-8?B?amVzc2UgamFtZXMgMjAyMA==?=
    Aug 18, 2006
  3. brett

    Wiring up dynamic control

    brett, Feb 13, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    384
    brett
    Feb 20, 2007
  4. zigjog
    Replies:
    0
    Views:
    167
    zigjog
    Sep 29, 2003
  5. Ryan Taylor
    Replies:
    1
    Views:
    199
    Ryan Taylor
    Jan 13, 2005
Loading...

Share This Page