asp.net Button OnClick event not firing

前端 未结 15 1640
闹比i
闹比i 2020-11-30 05:43

I have problem in asp.net button control.

I define a button in form, onclick event of button is not firing when I click on the button.

&         


        
相关标签:
15条回答
  • 2020-11-30 06:18

    If you are using updatepanel on onclick event, this may happen.

    Use 'EnableEventValidation="false"' in your page markup like this :

    <%@ Page Language="C#" MasterPageFile="~/ars_home.master" AutoEventWireup="true" CodeFile="Transaction_Window.aspx.cs" Inherits="Transaction_Window" EnableEventValidation="false" %>
    

    Hope this helps

    0 讨论(0)
  • 2020-11-30 06:18

    I had the same problem, my aspnet button's click was not firing. It turns out that some where on other part of the page has an input with html "required" attribute on.

    This might be sound strange, but once I remove the required attribute, the button just works normally.

    0 讨论(0)
  • 2020-11-30 06:30

    in my case: make sure not exist any form element in your page other than top main form, this cause events not fired

    0 讨论(0)
提交回复
热议问题