button firing click event twice

后端 未结 14 2108
忘了有多久
忘了有多久 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:09

    Just had to delve back into old school ASPX again and found this issue.

    My form was set up like this.

    
        
            
                
    

    The code behind was

    Protected Sub lbtnSendLoginDetails_Click(sender As Object, e As EventArgs) Handles lbtnSendLoginDetails.Click
    

    The answer for me was to remove the DefaultButton attribute from the Panel and add

    TabIndex="4" 
    

    to the LinkButton.

提交回复
热议问题