title: DefaultButton of 'panelName' must be the ID of a control of type IButtonControl
body: <p>I am developing a website on ASP.NET and using bootstrap for the design. I'm using modal fade class (like a popup) for user to login.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;div class="modal fade" id="login" role="dialog"&gt;
     &lt;asp:Panel ID="AZloginPanel" runat="server"&gt;
        &lt;div class="modal-dialog"&gt;
           &lt;div class="modal-content"&gt;
              &lt;div class="form-horizontal"&gt;
                 &lt;div class="modal-header"&gt;
                    &lt;h4&gt;Login&lt;/h4&gt;
                 &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                 &lt;asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false"&gt;
                    &lt;LayoutTemplate&gt;
                       &lt;span class="failureNotification"&gt;
                          &lt;asp:Literal ID="FailureText" runat="server"&gt;&lt;/asp:Literal&gt;
                       &lt;/span&gt;
                       &lt;asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="failureNotification"
                                          ValidationGroup="LoginUserValidationGroup" /&gt;
                       &lt;div class="accountInfo"&gt;
                          &lt;fieldset class="login"&gt;
                             &lt;div class="form-group"&gt;
                                &lt;asp:Label ID="UserNameLabel" CssClass="col-lg-2 control-label" runat="server" AssociatedControlID="UserName"&gt;Username:&lt;/asp:Label&gt;
                                  &lt;div class="col-lg-10"&gt;
                                     &lt;asp:TextBox ID="UserName" runat="server" CssClass="form-control" placeholder="Username"&gt;&lt;/asp:TextBox&gt;
                                  &lt;/div&gt;
                                  &lt;asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
                                                      CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required."
                                                      ValidationGroup="LoginUserValidationGroup"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                             &lt;/div&gt;
                             &lt;div class="form-group"&gt;
                                &lt;asp:Label ID="PasswordLabel" CssClass="col-lg-2 control-label" runat="server" AssociatedControlID="Password"&gt;Password:&lt;/asp:Label&gt;
                                &lt;div class="col-lg-10"&gt;
                                   &lt;asp:TextBox ID="Password" runat="server" CssClass="form-control" placeholder="Password" TextMode="Password"&gt;&lt;/asp:TextBox&gt;
                                &lt;/div&gt;
                                &lt;asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                      CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required."
                                                      ValidationGroup="LoginUserValidationGroup"&gt;*&lt;/asp:RequiredFieldValidator&gt;
                             &lt;/div&gt;
                             &lt;p&gt;
                                &lt;asp:CheckBox ID="RememberMe" runat="server" /&gt;
                                &lt;asp:Label ID="RememberMeLabel" runat="server" AssociatedControlID="RememberMe" CssClass="inline"&gt;Keep me logged in&lt;/asp:Label&gt;
                             &lt;/p&gt;
                          &lt;/fieldset&gt;
                          &lt;div class="modal-footer"&gt;
                             &lt;p class="pull-left"&gt;
                                  &lt;asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="false" NavigateUrl="~/Account/Register.aspx"&gt;Register&lt;/asp:HyperLink&gt;if you don't have an account.
                             &lt;/p&gt;
                                &lt;asp:Button ID="CloseModal" runat="server" CssClass="btn btn-info" CommandName="Close" Text="Close" /&gt;
                                &lt;asp:Button ID="LoginButton" runat="server" CssClass="btn btn-primary" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup" /&gt;
                           &lt;/div&gt;
                       &lt;/div&gt;
                    &lt;/LayoutTemplate&gt;
                 &lt;/asp:Login&gt;
              &lt;/div&gt;
           &lt;/div&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/asp:Panel&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I set <code>DefaultButton="LoginButton"</code> in <code>AZloginPanel</code> panel, I get the following error:</p>
  
  <blockquote>
    <p>The DefaultButton of 'AZloginPanel' must be the ID of a control of type IButtonControl.</p>
  </blockquote>
  
  <p>I'm lost and I've tried everything but it seems I'm at dead end.</p>
  
  <p>Any ideas?</p>