我有两个表单,每个表单都有按钮,我已经通过两个面板将它们抽象出来,所以当按下每个面板中的输入键时,将发送正确的按钮。在一个面板中,我有登录表单
<asp:Panel ID="pnlRegistered" runat="server" DefaultButton="btnLoginButton">
<LayoutTemplate>
<asp:Button ID="btnLoginButton" runat="server" CommandName="Login" Text="Login" ValidationGroup="Login1" OnClick="btnLoginButton_Click" ClientIDMode="Static" />
</LayoutTemplate>
<asp:Panel>
但我得到了例外
System.InvalidOperationException
The DefaultButton of 'pnlRegistered' must be the ID of a control of type IButtonControl.