vb.net dropdownlistfor from an enum
<p>Hi I need to do a dropdown list for to an enum.</p>

<p>For recover my enum, in my viewmodel I do like this :</p>

<pre><code>Public Property datatype As New List(Of DataTypeNameEnum)    
Dim values() As Integer = CType([Enum].GetValues(GetType(DataTypeNameEnum)), Integer())
For Each value In values
    datatype.Add(value)
Next
</code></pre>

<p>And in my view :</p>

<pre><code>@Html.DropDownListFor(Function(m) m.datattypeAsEnum, New SelectList(Model.datatype, "name", "name"))
</code></pre>

<p>But I have an error:</p>

<pre><code>name doesn't exist in DataTypeNameEnum
</code></pre>

<p>How I can to do for take values of my enum, and recover them in my selectList ?</p>

<p>edit : solved, i add attribute in jquery to my option.</p>