I'm trying to access my global.resx file from a static method... this is what i have
public static string GetElementTextLabel(string attributeName)
{
string retValue = string.Empty;
try
{
retValue = (string) HttpContext.GetGlobalResourceObject("Global", attributeName) ?? "(value needed)";
}
catch (NotImplementedException ex)
{
throw;
}
return retValue;
}
I get the following error:
it's giving an error, saying "An object reference is required for the non-static field, method, or property 'System.Web.Mvc.Controller.HttpContext.get'
how can i use the parameter in my search for the resource value... if i remove the static
then it works fine but now i need this method static