Submit button in embedded User Control doesnt work (C#)

Discussion in 'ASP .Net' started by temikolawole@gmail.com, Jan 19, 2006.

  1. Guest

    I have a user control on every single page on my website. Its called
    sidenav.ascx. It has a sidemenu and some extras. One of the extras is a
    login div that shows only when one of the images on the menu is
    clicked.

    It has an asp button to submit username ans password:

    <asp:button id="btnLogin" runat="server" cssClass="input1" Text="Login"
    Width="50" OnClick="btnLogin_Click"></asp:button>

    I have a codebehind for the user control (sidenav.ascx.cs) with a class
    supposed to be called when btnLogin is clicked:

    public void btnLogin_Click(object sender, System.EventArgs e)
    {
    ....
    }

    but it doesnt call the class. all it does is a postback and refreshes
    the page it's on.

    Can anybody help me out?
     
    , Jan 19, 2006
    #1
    1. Advertising

  2. KJ Guest

    If you click btnLogin in design view (assuming you are using visual
    studio), does it go to the correct codebehind code for btnLogin_Click?
     
    KJ, Jan 19, 2006
    #2
    1. Advertising

  3. Guest

    Yes it does. Just tried it.
     
    , Jan 19, 2006
    #3
    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. Chris Lane
    Replies:
    4
    Views:
    11,303
    Chris Lane
    Nov 17, 2003
  2. David Harris
    Replies:
    5
    Views:
    1,950
    David Harris
    Mar 25, 2005
  3. =?Utf-8?B?U3Bhcmt5IDcxNzc=?=

    Deployment issue: The submit button event doesnt fire on server.

    =?Utf-8?B?U3Bhcmt5IDcxNzc=?=, Apr 11, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    351
    =?Utf-8?B?U3Bhcmt5IDcxNzc=?=
    Apr 11, 2007
  4. Replies:
    3
    Views:
    456
    alex23
    May 27, 2008
  5. AleXmanFree
    Replies:
    3
    Views:
    591
    Hillbilly
    Oct 9, 2008
Loading...

Share This Page