How to handle localization/string values in an ASP.NET Web MVC project? -
I am trying to put all of my strings in the resource file, whatever I can do to all my Windows and Web form applications Do for me
Good works for changing string values for labels and / or moving apps.
I tried to add string values to my web MVC project, but this is the resource file in the view from inline code.
Is this possible? Is there a better way?
Where is your resource file? You have a few things that you have to do.
-
You must set up a custom device on the resource file ""
PublicResXFileCodeGenerator
", instead of just"ResXFileCodeGenerator
". The square is created as a public square instead of an internal class. -
Ensure that you are importing the namespace in your view. For example, if you want to enter the property folder If you are using it in your rez files, then
However, you can use " properties.Resource1. Myststring
"... you either just" the resource 1. Myststring
"or" MvcApplication1.Properties.Resource1.MyString
".
Hope that helps.
Comments
Post a Comment