简体   繁体   中英

ASP.NET defaultbutton not working in Google Chrome

This is a weird one for you...

I have a search box in my web form set up like so:

<asp:Panel id="pnlSearch" defaultbutton="btnSearch" runat="server">
  <asp:TextBox id="tbSearch" runat="server" />
  <asp:LinkButton id="btnSearch" onClick="EventHandler" runat="server" />
</asp:Panel>

In FireFox and IE the default button works fine. In Chrome, however, it doesn't work. Has anyone seen this behavior before and know of a fix? I thought the .NET framework would automatically wire up the correct button when it's set as a defaultbutton on the panel/form...

将defaultButton从linkBut​​ton更改为标准按钮可以解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM