Alex Dd

Alex Dd

  • NA
  • 40
  • 1.3k

Login in bootstrap modal

Feb 26 2017 4:01 PM
Hello,
 
I am a beginner to asp.net. I am currently working on a school project and I am using bootstrap modals for login and register. I am using the login and create user wizard and they work fine if i use them in a normal webform but the moment i insert them dynamically in my modal and press the button I get an error (

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
)
  1. <form id="formLogin" runat="server">  
  2.   
  3.        <%-- Modal --%>  
  4.   
  5.        <div class="modal-content">  
  6.            <div class="modal-header">  
  7.                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>  
  8.                <asp:Label ID="lblModalTitle" runat="server" CssClass="modal-title">Log in</asp:Label>  
  9.            </div>  
  10.   
  11.            <div class="modal-body">  
  12.   
  13.                <asp:Login ID="Login2" runat="server" CssClass="User" DestinationPageUrl="~/Login/Home.aspx">  
  14.                    <LayoutTemplate>  
  15.                        <div id="loginform" class="form-horizontal" role="form">  
  16.                            <div class="input-group">  
  17.                                <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>  
  18.                                <asp:TextBox runat="server" ID="UserName" CssClass="form-control" placeholder="User Name"></asp:TextBox>  
  19.                            </div>  
  20.                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="UserName" Display="Dynamic" ValidationGroup="Login" ErrorMessage="Please enter an User Name" CssClass="error">Please enter an User Name</asp:RequiredFieldValidator>  
  21.   
  22.                            <div class="input-group">  
  23.                                <span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>  
  24.                                <asp:TextBox runat="server" ID="Password" CssClass="form-control" placeholder="Password"  
  25.                                    TextMode="Password"></asp:TextBox>  
  26.                            </div>  
  27.                            <asp:RequiredFieldValidator ID="rfvPassword" runat="server" ControlToValidate="Password" Display="Dynamic" ValidationGroup="Login" ErrorMessage="Please enter a password" CssClass="error">Please enter a password</asp:RequiredFieldValidator>  
  28.   
  29.                            <div class="checkbox">  
  30.                                <label>  
  31.                                    <asp:CheckBox ID="RememberMe" runat="server" Text="Remember me" />  
  32.                                </label>  
  33.                            </div>  
  34.                            <div class="form-group">  
  35.                                <div>  
  36.                                    Don't have an account!  
  37.                                <%--Pressing the link will take us to the desired modal by using a javascript function --%>  
  38.                                    <a href="javascript:$('#myModal .modal-content').load('Modals/modalDefaultRegister.aspx',function(e){$('#myModal').modal('show');});">Register here</a>  
  39.                                </div>  
  40.   
  41.                            </div>  
  42.                            <button type="button" id="btnClose" class="btn btn-default" data-dismiss="modal">Close</button>  
  43.                            <asp:Button ID="LoginButton" runat="server" CommandName="Login" class="btn btn-primary" ValidationGroup="Login" Text="Log in" UseSubmitBehavior="false"  />  
  44.                        </div>  
  45.                    </LayoutTemplate>  
  46.                      
  47.                </asp:Login>  
  48.   
  49.            </div>  
  50.            <div class="modal-footer">  
  51.            </div>  
  52.        </div>  
  53.   
  54.    </form>  
 
 Any ideas on where the problem is and how can I solve it?
Thank you 

Answers (9)