更新时间:2023-10-13 12:48:28
错字,它应该是runat = server
例如
< button onserverclick =Next_Clickrunat =serverid =MyButton >
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
<a href="#" class="btn btn-xs button page-2-btn">next</a>
in .cs
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
Typo, it should berunat="server"e.g.
<button onserverclick="Next_Click" runat="server" id="MyButton">