Closed jaska45 closed 4 years ago
I have an enum
public enum Sport { [Display(Name = "Soccer")] Soccer, [Display(Name = "Ice hockey")] IceHockey, [Display(Name = "Basketball")] Basketball }
Then I use the following code in a view to populate a combo box:
<select class="form-control" asp-for="Sport" asp-items="Html.GetEnumSelectList<Sport>()"> </select>
Finally I added a localized .resx file: Models.Sport.fi.resx
This works in ASP.NET 2.2 but not 3.0
You can find a sample here
This was my mistake. The namespace in 3.0 sample was incorrect. The localization works. You can close this.
I have an enum
Then I use the following code in a view to populate a combo box:
Finally I added a localized .resx file: Models.Sport.fi.resx
This works in ASP.NET 2.2 but not 3.0
You can find a sample here