开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜