Hey SO:
I am trying to access my local resources file in my code-behind. I did some googling since I was unsure of how to do it and found this:
oContent.Text = HttpContext.GetLocalResourceObject("NonSupport").ToString();
However, I get an error saying that it needs at least two parameters: VirtualPath
and ResourceKey
. There is a third, CultureInfo
but that one is optional. When I put this in as my virtual path:
HttpContext.GetLocalResourceObject("App_LocalResources/ExpandableListView.aspx.resx", "NonSupport").ToString();
I get the following compiler error message:
The relative virtual path 'App_LocalResources/ExpandableListView.aspx.resx' is not allowed here.
I must be doing something wrong with this since my searches (and some posts I found on here) say all I need to do is call the resource key.
Any thoughts? Thanks!