Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created bootstrap button in apsx, I want to trigger the button click event for this. This is what my code looks

in .apsx
HTML
<a href="#" class="btn btn-xs button page-2-btn">next</a>


in .cs

C#
protected void Next_Click(object sender, EventArgs e)
    {
        string connStr = "Initial Catalog=LoginCheck; Data Source=MYCOMPUTER; User id=sa; password=abc12345;";
        
    }

However, I see that the code behind i.e .cs function is not invoked, on keeping the break point I see it does not get called. Please any help will be appreciated.

Thanks

What I have tried:

I have tried runat="sever" and onserverclick , even that did not work
Posted
Updated 31-Dec-16 16:07pm
v2

1 solution

Typo, it should be
C#
runat="server"
e.g.
<button onserverclick="Next_Click" runat="server" id="MyButton">
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900