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

Discussion in 'ASP .Net' started by ~~~ .NET Ed ~~~, Mar 5, 2005.

  1. 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?
     
    ~~~ .NET Ed ~~~, Mar 5, 2005
    #1
    1. Advertising

  2. 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?
     
    Calvin Luttrell, Mar 5, 2005
    #2
    1. Advertising

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

    "Calvin Luttrell" <> wrote in message news:%...

    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?
     
    ~~~ .NET Ed ~~~, Mar 7, 2005
    #3
  4. ~~~ .NET Ed ~~~

    nizarbabu

    Joined:
    Sep 8, 2008
    Messages:
    1
    Try to use ASp:linkbuttons instead of asp:button in the user control
     
    nizarbabu, Sep 8, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    857
    Purvi T
    Oct 19, 2004
  2. okaminer
    Replies:
    2
    Views:
    898
    okaminer
    Feb 8, 2005
  3. Replies:
    0
    Views:
    2,067
  4. GauravGupta
    Replies:
    4
    Views:
    2,109
    Shilpa1234
    Jan 19, 2012
  5. Max2006
    Replies:
    2
    Views:
    1,578
    Walter Wang [MSFT]
    Sep 19, 2007
Loading...

Share This Page