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

T

temikolawole

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

KJ

If you click btnLogin in design view (assuming you are using visual
studio), does it go to the correct codebehind code for btnLogin_Click?
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top