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

  • Thread starter ~~~ .NET Ed ~~~
  • Start date
N

~~~ .NET Ed ~~~

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?
 
C

Calvin Luttrell

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
 
N

~~~ .NET Ed ~~~

Thanks, it turned out to be a really silly typo error, looked over it so many times that it looked right...


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
 

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,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top