in Action
Dim ax = [Enum].GetValues(GetType(EnumType)).Cast(Of
EnumType )().Select(Function(v) New SelectListItem With {.Text = v.ToString(), .Value = CType(v, Integer)})
ViewData("EnumType") = New SelectList(ax, "Value", "Text", "")
in view(.aspx)
Dim si As SelectList = ViewData("ContenType"
%=Html.DropDownList("ContentType", si)
留言