Align text box with menu control using boostrap

Posted by JamesMitLondon on Stack Overflow See other posts from Stack Overflow or by JamesMitLondon
Published on 2013-11-12T01:13:18Z Indexed on 2013/11/12 3:54 UTC
Read the original article Hit count: 224

Filed under:
|

Hi I am using bootstrap styles for my asp.net web application and I have a menu control at the top. I want to insert a search text box at the top right on the same line as the menu bar. Following is my code. Can anyone please suggest how to do this? Thanks.

<div id="container">
    <form runat="server" class="navbar-form navbar-left" role="search">
    <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>

                <div class="nav-collapse collapse">
                    <asp:Menu ID="NavigationMenu" runat="server" EnableViewState="false"
                        IncludeStyleBlock="false" Orientation="Horizontal"
                        CssClass="navbar"
                        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 class="form-group">
            <input type="text" class="form-control" placeholder="Search"/>
        <button type="submit" class="btn btn-default">Submit</button>
          </div>    
          </div>                
            </div>          
        </div>
    </div>          
    </form>
    </div>
    `

menu_align

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about bootstrap