button with no postback?

后端 未结 5 1187
傲寒
傲寒 2021-02-05 02:33

Well i have a asp.net page where i have a button that im using to execute a JavaScript... but after the JavaScript has run the page reloads(postback) how can i avoid that?

5条回答
  •  天命终不由人
    2021-02-05 03:10

    You should just use an input button instead:

    
    

    this doest NEED an form (so you can use it without) and you dont have the problem with the postback.

    Hope this helps

提交回复
热议问题