0

What's the best way to acces .resx files in a Http Handler in ASP.NET?

I need to access them in javascript. My goal is to serialize them in JSON via a IHttpHandler. The problem is that I simply can't figure out which .resx I should load according to request language.

Thanks!

RooSoft
  • 1,481
  • 2
  • 17
  • 32

1 Answers1

1

you can use GetGlobaResourceObject or GetLocalResourceObject as here

http://msdn.microsoft.com/en-us/library/ms227982.aspx

Robert
  • 3,276
  • 1
  • 17
  • 26
  • I just found out that these lines work HttpContext.GetLocalResourceObject("/path/of/page.aspx", "resourceKey"); HttpContext.GetGlobalResourceObject("fileInApp_GlobalResources", "resourceKey") But how can I get all resources available from these resx files? – RooSoft Mar 18 '11 at 13:30
  • this could help: http://stackoverflow.com/questions/2041000/loop-through-all-the-resources-in-a-resx-file – Robert Mar 18 '11 at 13:45