html button on .cs page
i am using html button in .aspx page. but i want to use the开发者_JS百科 button_click event on .cs page..
i am adding html button as:
<button id="button1" runat="server" onclick="Submit_Click">
Send
</button>
and on .cs page i am usng:
protected void Submit_Click(object source, EventArgs e)
{
MessageBox.Show("ggg");
}
i don't want to use asp button .. and this is not calling the event from .cs page..
how this can be done..
You have to use onserverclick
instead of the onclick
method as this is a client side event of the HTML button control.
<button id="button1" runat="server" onserverclick="Submit_Click">
Send
</button>
精彩评论