Button Click Event does not fire

我的未来我决定 提交于 2019-12-25 02:16:43

问题


I have the following ASP-Markup:

<asp:Button runat="server" ID="btnSubmit" meta:resourcekey="btnSubmit" CssClass="submit" OnClick="btnSubmit_Click" />

And the following Code-Behind:

protected void btnSubmit_Click(object sender, EventArgs e)
    {
    }

For some reason, the Button Click Event does not fire ... it works on other pages with the exact same markup, I've tried doing "C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i" - didn't make a difference.

Also, there is nothing AJAXy going on in this page.

Any help would be greatly appreciated.

Thanks,

Dennis


回答1:


Try disabling the ValidationControls and see if the event fires.

Also try adding CauseValidation=false to the markup of your Button.



来源:https://stackoverflow.com/questions/8487383/button-click-event-does-not-fire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!