I need some help with the select tag helper in ASP.NET Core.
I have a list of employees that I\'m trying to bind to a select tag helper. My employees are in a
My answer below doesn't solve the question but it relates to.
If someone is using enum instead of a class model, like this example:
public enum Counter
{
[Display(Name = "Number 1")]
No1 = 1,
[Display(Name = "Number 2")]
No2 = 2,
[Display(Name = "Number 3")]
No3 = 3
}
And a property to get the value when submiting:
public int No { get; set; }
In the razor page, you can use Html.GetEnumSelectList to get the enum properties.
It generates the following HTML: