Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > User Control Button Click event not firing when placed in a Web form

Reply
Thread Tools

User Control Button Click event not firing when placed in a Web form

 
 
~~~ .NET Ed ~~~
Guest
Posts: n/a
 
      03-05-2005
I have a problem (don't we all?). I have a web form with multiple modules,
some of these modules have an ASP.NET (server run) button.

OK, now I have UserControlX which has one such button (say Login). In that
user control I defined both the Command and Click events for the button and
placed a break point on it (in addition to traces). This user control is
then included in the main form within the Form element/tags. Both the user
control and the button therein have EnableViewState set.

Then on the displayed web form I press the button contained in the module
and NOTHING HAPPENS!, no break point (yes, it is in Debug mode rather than
Release). I see the Page_Load being fired initially but there is never a
post back, nor there is a firing of the button's events of the user control.

I must be missing something simple but what is it?


 
Reply With Quote
 
 
 
 
Calvin Luttrell
Guest
Posts: n/a
 
      03-05-2005

Dear .Net Ed,

Is it possible you have a validator or something that is preventing the form from posting. If the page loading event is firing but not that post pack for the button make sure the button kept it's handle statement in the end of the sub routing. Sometimes copying and pasting controls around in the page causes them to loose their link to what is suppose to call them.

-Calvin Luttrell
ProjectThunder.com, Inc.
nothing is impossible


>I have a problem (don't we all?). I have a web form with multiple modules,
> some of these modules have an ASP.NET (server run) button.
>
> OK, now I have UserControlX which has one such button (say Login). In that
> user control I defined both the Command and Click events for the button and
> placed a break point on it (in addition to traces). This user control is
> then included in the main form within the Form element/tags. Both the user
> control and the button therein have EnableViewState set.
>
> Then on the displayed web form I press the button contained in the module
> and NOTHING HAPPENS!, no break point (yes, it is in Debug mode rather than
> Release). I see the Page_Load being fired initially but there is never a
> post back, nor there is a firing of the button's events of the user control.
>
> I must be missing something simple but what is it?


 
Reply With Quote
 
 
 
 
~~~ .NET Ed ~~~
Guest
Posts: n/a
 
      03-07-2005
Thanks, it turned out to be a really silly typo error, looked over it so many times that it looked right...

"Calvin Luttrell" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...

Dear .Net Ed,

Is it possible you have a validator or something that is preventing the form from posting. If the page loading event is firing but not that post pack for the button make sure the button kept it's handle statement in the end of the sub routing. Sometimes copying and pasting controls around in the page causes them to loose their link to what is suppose to call them.

-Calvin Luttrell
ProjectThunder.com, Inc.
nothing is impossible


>I have a problem (don't we all?). I have a web form with multiple modules,
> some of these modules have an ASP.NET (server run) button.
>
> OK, now I have UserControlX which has one such button (say Login). In that
> user control I defined both the Command and Click events for the button and
> placed a break point on it (in addition to traces). This user control is
> then included in the main form within the Form element/tags. Both the user
> control and the button therein have EnableViewState set.
>
> Then on the displayed web form I press the button contained in the module
> and NOTHING HAPPENS!, no break point (yes, it is in Debug mode rather than
> Release). I see the Page_Load being fired initially but there is never a
> post back, nor there is a firing of the button's events of the user control.
>
> I must be missing something simple but what is it?


 
Reply With Quote
 
nizarbabu nizarbabu is offline
Junior Member
Join Date: Sep 2008
Posts: 1
 
      09-08-2008
Try to use ASp:linkbuttons instead of asp:button in the user control
 
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
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 Building Controls 1 05-28-2004 06:23 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
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge ASP .Net Datagrid Control 0 05-25-2004 01:45 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 Web Controls 0 05-25-2004 01:45 AM



Advertisments