1

I'd like to use resource file (.resx) to do localization in ASP.NET MVC. My thought is:

  1. Make a default resource file under App_GlobalResources folder Make several local resource files under App_LocalResources folder
  2. read cookie info to set CultureInFo Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

then, I'd like to use resource file in controller to set ViewData value, something like:

ViewData["Title"] = Resources:Resource, PageTitle;

but the syntax is wrong, how can I do this?

Any idea?

1 Answer 1

1

Did you tried following?

ViewData["Title"] = Resources.Resource.PageTitle;

If you have Resource.aspx file in your App_GlobalResources this should work.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.