Click here to Skip to main content
14,669,375 members
Rate this:
Please Sign up or sign in to vote.
in ASP.NET master-page m usign bootstrap navigation bar. navigation bar have some links and dropdown named login menu, when i click on in dropdown login menu it works fine but as soon user click inside dropdwon login menu to to enter his username and passsword dropdown menu  gets toogle.
what i can do to solve this problem ?

here is my usermaster.master page source code

<code>
opeining html tag
opeining body tag
opeining form tag
    body
    form class="form-horizontal" role="form" id="Form1" runat="server"

    <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
        <div class="container">
         <a href="#" class="navbar-brand">Tarun Company</a>
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <div class="collapse navbar-collapse navHeaderCollapse">
                <ul class="nav navbar-nav navbar-right">
                   <!--Start of dropdown menu login menu control -->

                    <li class="dropdown" id="menuLogin1">
                        <a class="dropdown-toggle" href="#" data-toggle="dropdown" id="navLogin1">Login Menu</a>
                        <div class="dropdown-menu" style="padding: 10px;">
                            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                            <!-- starting of form -->
                            <%--<form class="form-horizontal" role="form" id="loginform" runat="server">--%>
                                <div class="form-group">
                                    <div class="col-sm-10">
                                        <asp:TextBox class="form-control" ID="txtemailid" runat="server" placeholder="Email ID"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-10">
                                        <asp:TextBox class="form-control" ID="txtpassword" runat="server" placeholder="Password"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-10">
                                        <asp:Button class="btn btn-primary btn-block pull-right" ID="btnSubmit" runat="server" Text="Sign in" />
                                        <br />
                                        <br />
                                        <a href="#" class="col-ms-4 pull-right">forget password ?</a>
                                    </div>
                                </div>
                         <%--   </form>--%>
                           <!-- Ending of form -->
                                </asp:ContentPlaceHolder>
                        </div>
                    </li>
                    <!-- End of dropdown menu login menu control -->
                </ul>
            </div>
        </div>
    </nav>


    <section>
        <div class="container">
           <asp:ContentPlaceHolder ID="mainsection" runat="server">

            </asp:ContentPlaceHolder>
            </div>
    </section>
</form>
    <footer class="navbar navbar-default navbar-fixed-bottom ">
        <div class="container">
            <p class="navbar-text pull-left">&copy; Tarun Jaiswal</p>
            <a href="https://www.twitter.com/TarunJaiswa" target="_blank" class="navbar-btn btn btn-success pull-right">follow me</a>
        </div>
    </footer>

    <!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>"></script> -->
    <script type="text/javascript" src="Scripts/jquery-2.1.0.min.js"></script>
    <script type="text/javascript" src="Scripts/bootstrap.min.js"></script>





after this is have closing form, body,html
Posted
Updated 31-Jul-19 5:33am

Rate this:
Please Sign up or sign in to vote.

Solution 1

Add on master page

below script

   <script type="text/javascript">        $(function () {
            // Setup drop down menu
            $('.dropdown-toggle').dropdown();

            // Fix input element click problem
            $('.dropdown input, .dropdown label').click(function (e) {
                e.stopPropagation();
            });
        })</script>



it will work
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

It's works!! Thanks for the answer!!
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100