ASP.NET MVC ListBox - Height

auto
  • Zimbabwe230
  • Zambia229
  • Yemen228
  • Wallis and Futuna227
  • Wales226
  • Virgin Islands225
  • Vietnam224
  • Venezuela223
  • Vatican City222
  • Vanuatu221
  • Uzbekistan220
  • USA219
  • Uruquay218
  • United Arab Emirates217
  • Ukraine216
  Height="150"
  • Zimbabwe230
  • Zambia229
  • Yemen228
  • Wallis and Futuna227
  • Wales226
  • Virgin Islands225
  • Vietnam224
  • Venezuela223
  • Vatican City222
  • Vanuatu221
  • Uzbekistan220
  • USA219
  • Uruquay218
  • United Arab Emirates217
  • Ukraine216
The Height property is used to control the height of the ListBox. If the property is not set, the control will expand to fit all the items in the list (no scrollbars). If the property is set, but there are only a few items (less than the specified height), no scrollbars will be displayed.
View - Aspx

    <% Html.Obout(new ListBox("ListBox1")
    {   
        Height = 150
    }); %> 
    
    
View - Razor

    Html.Obout(new ListBox("ListBox1")
    {   
        Height = 150
    })