button firing click event twice

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

    The solution is already been mentioned in different answer . Use type ="button" instead of submit

    Here is a sample code

        
          
           
    

    And the backend code to handle the on click

     protected void btnLoadCustomerFile_Click(object sender,EventArgs e)
        {
            LoadCustomerFile();
          }
    

提交回复
热议问题