Don't forget the colon on ASP.NET MVC Html helpers!

Note to self: On ASP.NET MVC 2, when using Html helpers, like Html.DropDownListFor, they don't work if you leave out the colon after the opening "crow's beak".

This won't work:

<% Html.DropDownListFor(model => model.Country, ViewData["Countries"] as SelectList) %>

This will:

<%: Html.DropDownListFor(model => model.Country, ViewData["Countries"] as SelectList) %>

Comments

Popular posts from this blog

Restoring Color Icons in Gimp 2.10

My Nullable DateTime Picker

PowerBuilder and SQL Server: Tips On Working Together