ASP.NET MVC ListBox - Style Gallery

  • black_glassblack_glass
  • grand_graygrand_gray
  • premiere_bluepremiere_blue
  • plainplain
The ListBox comes with predefined styles which are suited for most page layouts.

The styles can be switched easily using the FolderStyle property, which needs to contain
the relative path to the folder containing the style to be used.
View - Aspx
 
    <% Html.Obout(new ListoBox("ListBox1") 
    {                
        FolderStyle = ViewData["ListBox1_FolderStyle"].ToString()
    }); %>
    
View - Razor
 
    @Html.Obout(new ListBox("ListBox1") 
    {                
        FolderStyle = ViewData["ListBox1_FolderStyle"].ToString()
    })