button firing click event twice

后端 未结 14 2414
忘了有多久
忘了有多久 2021-02-07 21:28

It seems that sometimes (but not always) my button click event is being fired twice. The fact that it seems to happen sometimes but not always is really puzzling me. Here is m

14条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-07 22:02

    The correct way (in the ASP.NET Web Form Page), as already pointed out by couple of other contributors, is to add the type="button" attribute to the element, and associate a onserverclick event delegate handler.

    For example:

    
    

    Hope this helps.

提交回复
热议问题