简体   繁体   English

如何在同一行上使用Bootstrap样式对齐三个ASP.NET控件?

[英]How can I align three ASP.NET controls using Bootstrap styles on the same line?

        <div id="search-container">
            <div class="form-inline">
                <asp:DropDownList ID="drpSearchFilter" runat="server" CssClass="form-control">
                    <asp:ListItem>Title</asp:ListItem>
                    <asp:ListItem>Author</asp:ListItem>
                    <asp:ListItem>Keywords</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="txtSearchBox" CssClass="form-control" runat="server"/>
                <asp:Button ID="btnSearch" runat="server" Text="Search" CssClass="btn btn-default" OnClick="btnSearch_Click"/>
            </div>
        </div>

Right now all of these controls are appearing on separate lines. 现在,所有这些控件都显示在单独的行上。

Try this one (from the Bootstrap documentation ): 试试这个(从Bootstrap文档中 ):

<form class="form-inline">
  <div class="form-group">
    <label for="exampleInputName2">Name</label>
    <input type="text" class="form-control" id="exampleInputName2" placeholder="Jane Doe">
  </div>
  <div class="form-group">
    <label for="exampleInputEmail2">Email</label>
    <input type="email" class="form-control" id="exampleInputEmail2" placeholder="jane.doe@example.com">
  </div>
  <button type="submit" class="btn btn-default">Send invitation</button>
</form>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Postmark进行ASP.NET登录控件? - How can I use Postmark for ASP.NET Login controls? 如何启用/禁用asp.net表单/控件 - How can I enable/disable an asp.net form/controls 如何将控件异步添加到asp.net页? - How can I asynchronously add controls to a asp.net page? 如何使用asp.net控件创建具有动态列的表? - How can I create a table with dynamic columns using asp.net controls? ASP.NET MVC:在同一行上对齐复选框和标签 - ASP.NET MVC: Align checkbox and label on same line 我想访问for loop.so中的asp.net服务器控件的“ ids”,因此我可以单行设置所有控件的值 - i want to access 'ids' of asp.net server controls in for loop.so with single line i can set value to all controls 如何删除默认情况下应用于ASP.net验证控件的样式? - How to Remove Styles which by default apply in ASP.net Validation Controls? 我可以串联用于ASP.NET控件中数据绑定的“ &lt;%#%&gt;”吗? - Can I concatenate “<%# %>” used for databinding in ASP.NET Controls 使用Bootstrap和ASP.NET在面板内向左对齐文本但向右对齐按钮 - Left align text but right align button inside of a panel using Bootstrap and ASP.NET 使用ASP.NET,如何通过同一对话框选择多个文件 - Using ASP.NET, how can I select multiple files through the same dialog
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM