Search code examples
fileresx

reading resource file strings from a .resx file in .cs file


My solution has Messages.resx file under App_GlobalResources in my solution. Everytime i create a string and give a value to the string

internal static string Alert_EnterUserName { get { return ResourceManager.GetString("Alert_EnterUserName", resourceCulture); } }

is created automatically. (resource generator)

I want to use these strings in my cs file. Can anybody help me on this?

Thanks


Solution

  • figured it out myself:

    var = HttpContext.GetGlobalResourceObject(“Resourcefilename”, “resourcekey″).ToString();