razorresourcesapp-globalresources

Access a global resource from cshtml


I create a web app in visual studio 2012 and I also create a global resource file in order to use the same page in different languages.

I create a few key-value for each language I want and now Im trying to get that value from the cshtml.

I tried the following:

@Resources.Content.ES.UserInformation

where Content.ES is the name of the file and UserInformation is is the key.

When I wrote that line I have an error message saying that Resources doesnt exist.

Any help will be appreciate it!

Thanks!!


Solution

  • The problem was that I was naming the resource as @Resources.Content.ES.UserInformation and the .ES was confusing it. So I changed it to Content and its all good now.