must click button twice for event to fire

Discussion in 'ASP .Net Web Controls' started by Jon Prisbe, Apr 10, 2006.

  1. Jon Prisbe

    Jon Prisbe Guest

    I have a web site with a default page and several user controls on the page
    that get set to visible or invisible dependign on the menu optonthe user
    chooses.

    One control has another user control on it (child) and that use control can
    have one or more user controls on it (grand children).

    Problem:
    The link buttons on the child and grand children have to be clicked twice
    for the event handler to get called. Order doesn't matter. If I click button1
    first and then button2, button2's event handler gets fired. If I click
    button1 first and then button1 again, button1's event handler gets fired.
    Order doesn't seem to make any difference, acts like the first click cocks
    the gun and the second click fires. Does this for all controls on the child
    and grand children.

    Any ideas what to look at?

    Thanks,
    Jon
     
    Jon Prisbe, Apr 10, 2006
    #1
    1. Advertising

  2. It has to do with the stage within the page’s lifecycle when you turned the
    child controls visible (i.e. created them) and therefore their viewstate was
    saved and loaded upon the next postback. Can you post the logic of setting
    the controls visible indicating at which stage (at which event handling) do
    set them to visible?
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "Jon Prisbe" wrote:

    > I have a web site with a default page and several user controls on the page
    > that get set to visible or invisible dependign on the menu optonthe user
    > chooses.
    >
    > One control has another user control on it (child) and that use control can
    > have one or more user controls on it (grand children).
    >
    > Problem:
    > The link buttons on the child and grand children have to be clicked twice
    > for the event handler to get called. Order doesn't matter. If I click button1
    > first and then button2, button2's event handler gets fired. If I click
    > button1 first and then button1 again, button1's event handler gets fired.
    > Order doesn't seem to make any difference, acts like the first click cocks
    > the gun and the second click fires. Does this for all controls on the child
    > and grand children.
    >
    > Any ideas what to look at?
    >
    > Thanks,
    > Jon
     
    Phillip Williams, Apr 10, 2006
    #2
    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. Purvi T
    Replies:
    0
    Views:
    905
    Purvi T
    Oct 19, 2004
  2. mike parr
    Replies:
    1
    Views:
    516
    Marina
    May 20, 2004
  3. Amy
    Replies:
    0
    Views:
    1,019
  4. dilbert
    Replies:
    0
    Views:
    477
    dilbert
    Jan 28, 2008
  5. dilbert
    Replies:
    0
    Views:
    467
    dilbert
    Jan 28, 2008
Loading...

Share This Page