enum

Sep 21 2009

Enum DropDownList in ASP.NET MVC

I created an HTML Helper for rendering a dropdownlist aka select element from the name/value pairs in an enum and thought I would share.

Jul 01 2009

Iterating enum names and values in C#

Have you ever wanted to create a SELECT element with the names and values of an enum Type? I'll readily admit, in my earlier programming days I used to create the control manually.

Thanks to the C# System.Enum class in .NET and its static helper methods, I can enumerate the Names and Values in an enum Type, increasing maintainability of my application.

Recent comments