RickStrahl / Westwind.Globalization

Database driven resource localization for .NET applications
544 stars 135 forks source link

Can this be used with DisplayAttribute on MVC Models? #64

Closed smitterson closed 8 years ago

smitterson commented 8 years ago

As I am sure you are aware, when using standard .NET Resources you can put a DisplayAttribute on a MVC model property such as: [Display(Name = "MiddleInitial", ResourceType = typeof(Resources.Resources))] public string MiddleInitial { get; set; }

This allows you to create a label on the MVC view via: @Html.LabelFor(x => x.MiddleInitial)

In order to maintain this with Westwind.Globalization, would I need to create strongly typed resources from the db resources? My guess is yes based on how Html.LabelFor works. Just wanted to be sure before spending time on switching to this.

Thanks!

smitterson commented 8 years ago

Nevermind! I see this page (https://github.com/RickStrahl/Westwind.Globalization/wiki/Model-Validation-Message-for-ASP.NET-and-EntityFramework) references using this with validation, which is a similar case.