Friday, 15 June 2012

Add Enumeration value to dropdown list in C#

step 1==>Create Enum in class
step ==> Add dropdown list in aspx page
step ==> add below code to .cs page

dropdownlistname.DataSource = Enum.GetValues(typeof(enumClassName.MethodName));
dropdownlistname.DataBind();

1 comment: