Ganesha K
Ganesha K

Reputation: 37

Razor htmlListBox helper

@Html.ListBoxFor(m => m.SelectedClients, new SelectList(Model.allClients, "ClientId", "Name"))

The above code refer to the Razor html helper for HTML List box.

How to set the size=20 in the above code?

Upvotes: 1

Views: 25

Answers (1)

user3559349
user3559349

Reputation:

You need to use the overload that accepts htmlAttributes

@Html.ListBoxFor(m => m.SelectedClients, new SelectList(....), new { size = "20" })

Upvotes: 1

Related Questions