按钮点击/表单提交时关闭Bootstrap模式

时间:2016-11-30 07:29:01

标签: jquery asp.net html5 twitter-bootstrap css3

我在“登录”按钮上单击打开一个模态。我在模态中有另一个按钮,onclick将隐藏div。但是一旦我点击按钮,模态就会关闭。然后再次在“登录”按钮上单击模式将显示隐藏div。我不希望模态关闭。请帮忙。我是bootstrap的新手

   <div class="modal fade" id="BPA" data-keyboard="false" data-backdrop="static" role="dialog">
        <div class="modal-dialog ">
            <!-- Modal content-->
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" data-dismiss="modal" class="close" >&times;</button>
                   <br /> <h4>Sign In</h4>
                </div>

                <div class="modal-body">
                    <div class=" row">
                      <form id="Form1" runat="server">
                        <div class="col-md-4">


      <div runat="server" id="hide"> 

  <label for="exampleInputEmail1">Username</label>                       
  <asp:TextBox ID="txtUname1" runat="server"  class="form-control"  placeholder="Enter your username"></asp:TextBox>
  <label  for="exampleInputEmail1" >Password</label>
  <asp:TextBox ID="txtPwd1" TextMode="Password" runat="server"  class="form-control"  placeholder="Enter password" ></asp:TextBox>
 <asp:Button ID="btnSignin" class="btn btn-primary btn-block shadow" runat="server" Text="Sign in" OnClick="btnSignin_click" />   
    <asp:Label ID="errorLbl" runat="server" CssClass="text-danger"></asp:Label>

      </div>


      <div runat="server" id="Recoveremail" Visible="false"> 

  <label  for="exampleInputEmail1" >Enter your Email address</label>
  <asp:TextBox ID="Txtemail"  runat="server"  class="form-control"  placeholder="Enter email address" ></asp:TextBox>
   <asp:Button ID="Txtrecovery" class="btn btn-primary btn-block shadow" runat="server" data-target="#BPA" data-toggle="modal" Text="Submit" OnClick="btnRecoverSubmit_Click" /> 
    <label id="lbltxt" runat="server"></label>

      </div>  

         <asp:Label ID="Upwd" runat="server" Text="Forgot"></asp:Label>
         <asp:LinkButton ID="LinkButton1" type="button" runat="server" Text="Password?" OnClick="btnPwdSubmit_Click"/>

                               </div>
                          </form>
                    </div>

                <div class="modal-footer">
                </div>
            </div>
        </div>
    </div>
        </div>

0 个答案:

没有答案