must click button twice for event to fire

J

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
 
P

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top