Home All Groups Group Topic Archive Search About

must click button twice for event to fire

Author
10 Apr 2006 2:33 PM
Jon Prisbe
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

Author
10 Apr 2006 2:49 PM
Phillip Williams
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?
Show quoteHide quote
"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