How to handle localization / string values ​​in an ASP.NET Web MVC project?

I am trying to put all my lines in a resource file, something that I am doing for all Windows applications and Web Forms.

Works great when changing string values ​​for labels and / or application localization.

I tried to add string values ​​to my Web MVC project, but cannot access the resource file from the inline code in the view.

Is it possible? Is there a better way?

+3
source share
1 answer

Where is your resource file? There are a few things you need to do.

  • "PublicResXFileCodeGenerator", "ResXFileCodeGenerator". , , .

  • , . , "" resx,

"Properties.Resource1.MyString"... "Resource1.MyString", "MvcApplication1.Properties.Resource1.MyString".

, .

+5

Source: https://habr.com/ru/post/1713397/


All Articles