1
I created the following helper:
public static HtmlString DropDownListEnum<TEnum>(this HtmlHelper htmlHelper, string name, int? valorSelecionado = null)
{
List<SelectListItem> lstEnum = AttributesHelper.ToSelectList<TEnum>(valorSelecionado);
MvcHtmlString html = htmlHelper.DropDownList(name, lstEnum, new object { });
return html;
}
And when trying to call it in the View Tenum was identified as an html tag.
@Html.DropDownListEnum<TipoObjetoEnum>("ddlTeste", Model.IdTipoObjetoFK)
How I make html to interpret TipoObjetoEnum
as a Tenum instead of a tag?
See if this helps you: http://stackoverflow.com/a/5285842/221800
– Maniero