Difference between asp:button and html's button

前端 未结 2 1495
暗喜
暗喜 2020-12-19 13:19

I\'m learning asp.net. I have question about example buttons

I can use two types of button.

   

        
相关标签:
2条回答
  • 2020-12-19 13:50

    Each click will make a round trip to server, which should not occur everytime. HTML Button is much lighter and should be used to make client - logic like client validation, run client script,etc....
    ASP button will makes a POST everytime you click, html button do not.

    0 讨论(0)
  • 2020-12-19 13:59

    One is a server control (the asp button) that when rendered on the page includes javascript that handles the postback logic, as well as being exposed to your code-behinds as a control you can address by its ID. The Html control is platform agnostic, and is rendered by your browser as just a button. That button will raise click events but will not POST your form.

    0 讨论(0)
提交回复
热议问题