User Control within User Control - Event not firing

Discussion in 'ASP .Net' started by Don, Mar 11, 2005.

  1. Don

    Don Guest

    I have a User Control called Menu that is used in another User Control
    called header. It seems the button clicked event in the first control
    (Menu) is not firing.

    If I click a button on the menu the page will reload but the code in
    the button click event in the code-behind is newver executed. If I put
    this menu control on a page directly ir works.

    Aby ideas?

    Don
     
    Don, Mar 11, 2005
    #1
    1. Advertising

  2. Don

    Karl Seguin Guest

    Don:
    Are any of the user controls dynamically loaded? If so make sure they are
    dynamically recreated on postback....same with the button

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    "Don" <> wrote in message
    news:...
    > I have a User Control called Menu that is used in another User Control
    > called header. It seems the button clicked event in the first control
    > (Menu) is not firing.
    >
    > If I click a button on the menu the page will reload but the code in
    > the button click event in the code-behind is newver executed. If I put
    > this menu control on a page directly ir works.
    >
    > Aby ideas?
    >
    > Don
    >
     
    Karl Seguin, Mar 11, 2005
    #2
    1. Advertising

  3. Don

    Don Guest

    The control in question is dynamically created and it is recreated on
    postback. When the page refrsh I see the controls it's just that the
    button click event is not getting picked up.
     
    Don, Mar 11, 2005
    #3
  4. Don

    Karl Seguin Guest

    Make sure the controls are re-created in the same order and that they share
    the same Ids....events are raised based on control ids which (a) you can
    force to be different or (b) could be generated differently both of which
    you want to make sure aren't happening

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/ - New and Improved (yes, the popup is
    annoying)
    http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
    come!)
    "Don" <> wrote in message
    news:...
    > The control in question is dynamically created and it is recreated on
    > postback. When the page refrsh I see the controls it's just that the
    > button click event is not getting picked up.
    >
     
    Karl Seguin, Mar 11, 2005
    #4
    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. Tim Thomas
    Replies:
    3
    Views:
    809
  2. sanju
    Replies:
    2
    Views:
    3,789
    sanju reddy
    Jun 17, 2004
  3. vatech1993
    Replies:
    4
    Views:
    5,693
    =?Utf-8?B?U8Opcmdpbw==?=
    Dec 11, 2004
  4. Paul L
    Replies:
    1
    Views:
    7,304
  5. Paul L
    Replies:
    0
    Views:
    255
    Paul L
    May 5, 2005
Loading...

Share This Page