How to add localization in C#

  1. right click / project name / add / add ASP.net folder / App_GlobalResources

2. right click on App_LocalResources / Add / New Add Item

3. importtant
click the resouce file and the file name DON’T Add any Dash
otherwise the auto-generated file ResourceXXX.Designer.cs will not work.

4. click property and set your own name and value.

5. add Resources and Globalization in your .cs
using System.Resources;
using System.Globalization;

6. use in .cshtml
@yourProjectName.App_LocalResources.ResourceKorea.indexTitle

Result:

--

--

Jameskrauser Lee

For the last few years. i was involved mostly in the development of Automatic Fare collection system for the Chennai Metro. Familiar with C++ and iOS.