How to style asp.net menu control with responsive bootstrap css

9.3k Views Asked by At

http://techbrij.com/responsive-menu-twitter-bootstrap-asp-net

I followed this link to make the menu control responsive but no luck.Can someone tell me what's wrong in this link?

I copied the code below in the code to see how it becomes responsive upon resizing the browser. I noticed that on hover function is still active instead of click on ipad mode.

<div class="navbar">
<div class="navbar-inner">
    <div class="container">
     <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>
    <!-- Everything you want hidden at 940px or less, place within here -->
        <div class="nav-collapse collapse">
            <asp:Menu ID="NavigationMenu" runat="server" EnableViewState="false"
                IncludeStyleBlock="false" Orientation="Horizontal"
                CssClass="navbar navbar-fixed-top"
                StaticMenuStyle-CssClass="nav"
                StaticSelectedStyle-CssClass="active"
                DynamicMenuStyle-CssClass="dropdown-menu">
                <Items>
                    <asp:MenuItem Text="Home" ToolTip="Home"></asp:MenuItem>
                    <asp:MenuItem Text="Music" ToolTip="Music">
                        <asp:MenuItem Text="Classical" ToolTip="Classical" />
                        <asp:MenuItem Text="Rock" ToolTip="Rock" />
                        <asp:MenuItem Text="Jazz" ToolTip="Jazz" />
                    </asp:MenuItem>
                    <asp:MenuItem Text="Movies" ToolTip="Movies">
                        <asp:MenuItem Text="Action" ToolTip="Action" />
                        <asp:MenuItem Text="Drama" ToolTip="Drama" />
                        <asp:MenuItem Text="Musical" ToolTip="Musical" />
                    </asp:MenuItem>
                </Items>
            </asp:Menu>
        </div>
    </div>
</div>

1

There are 1 best solutions below

2
On

hi there as I know this js code will help you

<script type="text/javascript">
    //Disable the default MouseOver functionality of ASP.Net Menu control.
    Sys.WebForms.Menu._elementObjectMapper.getMappedObject = function () {
        return false;
    };
</script>