Search code examples
c#asp.netglobalization

ASP.NET Strongly-typed globalization resource values


I'm having trouble with accessing strongly typed values from my global resource file. VS 2010 is not providing the intellisense, and it is failing while compiling, saying that the type or namespace doesn't exist. Here's my code:

lblGlobalResourceST.Text = System.Resources.GlobalResource.MyName; //MyName is the key/name

My Key/Name pair is : MyName , Matt

Resource File Name: GlobalResource.resx located in root/App_GlobalResources

Framework: 4.0

Language: C#

According to MSDN ,

Resources are compiled into the namespace Resources, and each default resource becomes a member of the Resources class


Solution

  • I had to have a

    using Resources;
    

    statement at the top of the code.