I want to create custom Html Helper for my model that contains multiple attribute (50 label, 20 textbox, 5 dropdown list, 6 checkbox, ...) which there is some their type is Enum:
This is my Enum Class:
public enum ClassType
{
variable1,
variable2,
...
}
This is The model that contains an Enum attribute:
public class Test2Models
{
[Required]
[Display(Name = "SelectList")]
public ClassType InitialValue2 { get; set; }
...
}
Now i want to create a custom Html Helper in which i will give the InitialValue2 and i want him to return all the attributes.
public static MvcHtmlString Form<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression }
{
///
}
To be more clear i want the call of my custom Html Helper like this:
@html.form(it=>it.InitialValue2)
and the result i want a list of input
Could you help me please?