I recently started learning ASP.NET and have been following the Getting Started with ASP.NET MVC 5 tutorial on the official asp.net website.
While working on my project, I encountered an issue with styling my drop down box using Bootstrap. The code I was using displayed it as a standard drop down, but I couldn't figure out how to apply the desired styling.
Original code:
Genre: @Html.DropDownList("movieGenre", "All")
After making some changes:
@Paul helped me find the solution:
@Html.DropDownList("movieGenre", (SelectList)ViewBag.movieGenre, "Select genre", new { @class = "form-control" })
Appreciate all the assistance provided by everyone.