Difference betwen button and asp:button onclick

后端 未结 5 2251
鱼传尺愫
鱼传尺愫 2020-12-14 08:49

I am new to developing in asp.net for making web sites. So I having some trouble understanding the difference between the following. What is the difference between an asp:Bu

5条回答
  •  半阙折子戏
    2020-12-14 09:17

    to my understanding you have to keep in mind that there is a cliend side code that will execute, for example javascript in your browser, and asp/c# code that will execute on the server.

    So having this control:

      
    

    Button1_Click will execute on the server, in microsoft world it is IIS, on the other hand you have just a pure html control, where you hook up a javascript function for the click event

      
    

    So the server side has nothing to do with this part, this code will execute on your machine, in your browser.

提交回复
热议问题