Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpContext.GetGlobalResourceObject always returns null

I created two files in the App_GlobalResources folder:

SiteResources.en-US.resx
SiteResources.sp-SP.resx

Both contain a value for "SiteTitleSeparator".

Here is what I am trying to do (The following line always returns null):

string sep = (string)GetGlobalResourceObject("SiteResources", "SiteTitle");

Note, that the Culture property on the page is set.

Answers in both VB and C# will be welcomed.

like image 915
Shimmy Weitzhandler Avatar asked Jan 23 '23 11:01

Shimmy Weitzhandler


1 Answers

I changed the name of SiteResources.en-US.resx to SiteResources.resx and now everything works just fine.

Seems theer must be one invariant resource.

like image 118
Shimmy Weitzhandler Avatar answered Jan 26 '23 00:01

Shimmy Weitzhandler