Search code examples
asp.netlocalizationcode-behindresx

How do I call GetLocalResource in another class


So I have Test1.aspx, Test1.aspx.vb. The LocalResource files, in the App_LocalResources folder, Test1.aspx.resx and Test1.aspx.es.resx. I also have a class called TestTheData.vb in the App_Code folder.

Now what I want to do is call GetLocalResource("stringObjRes").ToString in the TestTheData.vb class. The method however is not showing up in Intellisense. When I try to type manually, I get the error lines in my code.

I've imported:

  • Globalization
  • Threading
  • Threading.Thread
  • Web
  • Web.UI.Page.

No luck. So how I am supposed to do this....?


Solution

  • Well it seems that Local Resources can't be accessed in files that are in the App_Code folder. So I used Global Resources instead.