NonProfit CMS joins Gray Digital Group

Gray Digital Group is a full service digital marketing agency in San Antonio, TX.

Gray Digital Group works with clients all over the country. Our client base is comprised of large national health systems, small to medium-sized businesses, law firms and non-profits.

Our Location


117 W Mistletoe Ave, San Antonio TX 78212

Office: (210) 820-0566
Fax: (210) 829-8361

Part of Gray Digital Group

LATEST FROM THE BLOG

COMPANY NEWS AND INDUSTRY INSIGHTS

C# ASP.NET Drop Down List function for enums

Posted on 31st May 2013 by Gray Digital
By Admin |May 31st, 2013

Enums are convenient in c#, and we use them for a variety of reasons such as roles, or statuses. For example, we can have a public enum Roles { Subscriber, Editor, Admin } …And it is often the case that we want drop down lists in forms on the front end for specifying which role a particular user is.  We also wanted one function to ‘rule them all’ so that you do not need a new function for every new enum you create.

Here is our result:

and you would use it by

var dropDownList = EnumDropDownList<Roles>()

Comments are closed.