Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > must click button twice for event to fire

Reply
Thread Tools

must click button twice for event to fire

 
 
Jon Prisbe
Guest
Posts: n/a
 
      04-10-2006
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
 
Reply With Quote
 
 
 
 
Phillip Williams
Guest
Posts: n/a
 
      04-10-2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
have to click 'edit' button twice for event handler to fire. dilbert ASP .Net 0 01-28-2008 05:26 PM
have to click 'edit' button twice for event handler to fire. dilbert ASP .Net 0 01-28-2008 05:25 PM
How to fire both event button click and textchanged when button is click and text is changed Amy ASP .Net 0 06-01-2006 02:33 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net 2 05-25-2004 11:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57