Edit based on comments, including best practices:
To create a resource file in MVC4: In the Solution Explorer, right-click on your project. Then you click Add, then Add ASP.Net Folder, and then click App_GlobalResources. In the new folder, right-click. Then you add a new resource file.
You open this resource file and you can add new resources. The lefter column is where you set the keys, and the earlier one is for the values ββyou must insert inside it.
Then; it is very simple, you just need to write the following parts of the code to get the values ββyou need.
On the C # side, this is:
Resources.NameOfYourResFile.NameOfYourResKey
On the ASP side, assuming you are using a razor, this is:
@Resources.NameOfYourResFile.NameOfYourResKey
Example: If you created an aa file named "Global.resx" and created an "ApplicationTitle" key that has the value "My Super Site" as the value, you just need to write the following line of code to put it, for example, in the line :
string siteTitle = Resources.Global.ApplicationTitle;
and what is he
source share