Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding style for asp.net drop-down list control using bootstrap v3

I was trying to add style for asp.net drop-down list control using bootstrap 3. But it is not applying. Earlier it worked with bootstrap 2.3.2 without any changes.

Can anybody suggest me a way to do this. Many thanks.

like image 608
user2848976 Avatar asked Oct 23 '13 12:10

user2848976


People also ask

How do I add a drop down menu in Bootstrap?

To open the dropdown menu, use a button or a link with a class of . dropdown-toggle and the data-toggle="dropdown" attribute. The . caret class creates a caret arrow icon (), which indicates that the button is a dropdown.

How set dropdown position in Bootstrap?

By default, a dropdown menu is automatically positioned 100% from the top and along the left side of its parent. Add . dropdown-menu-right to a . dropdown-menu to right align the dropdown menu.

Does Bootstrap work with ASP NET?

Since Bootstrap is all HTML, CSS and JavaScript, all open standards, you can use it with any framework including ASP.NET MVC. When you start a new MVC project, Bootstrap will be present, meaning you'll find Bootstrap. css and Bootstrap. js in your project.

What is drop down menu in Bootstrap?

Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown JavaScript plugin. They're toggled by clicking, not by hovering; this is an intentional design decision.


2 Answers

I would say this would be enough:

<asp:DropDownList runat="server" CssClass="form-control" ID="something" />

Take a look at bootstrap docs and scroll down to the Selects section.

like image 164
Morpheus Avatar answered Oct 04 '22 20:10

Morpheus


You can use this and change btn whatever you want: <asp:DropDownList Width="100%" CssClass="btn btn-default btn-sm" ID="DPCID" runat="server"/>

like image 31
Mohsen Fathi Avatar answered Oct 04 '22 21:10

Mohsen Fathi