locked
How to load the resource files? RRS feed

  • Question

  • User-1457962578 posted
    Hello, I'm using VS.NET 2003, VB.NET. My project structure is like this: myAppName (root) | - resources | - resources.resx - resources.de-DE.resx Inside my global.asax.vb I have this: [Application_Start] ResourceManager.CreateFileBasedResourceManager("Resources", Server.MapPath("resources") + Path.DirectorySeparatorChar, Nothing) and [Application_BeginRequest] Try Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(Request.UserLanguages(0)) Catch Thread.CurrentThread.CurrentCulture = New CultureInfo("de-DE") End Try Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture Inside my default.aspx.vb I have this: [Page_Init] rm = Application("RM") If (rm Is Nothing) Then Server.Transfer("Error.aspx") End If and [Page_Load] labelEmpty.Text = rm.GetString("t1") The problem is is that it can't find the resources files. Does somebody knows a solution? Thanks!
    Friday, August 27, 2004 12:28 PM

All replies

  • User-494817356 posted
    I have the same problem.
    Saturday, February 19, 2005 6:44 AM
  • User-125436819 posted
    instead of: ResourceManager.CreateFileBasedResourceManager("Resources", Server.MapPath("resources") + Path.DirectorySeparatorChar, Nothing) try: new ResourceManager("a", Assembly.GetExecutingAssembly()); where a = namespace+class that contains your resources Good luck, Owin
    Monday, February 28, 2005 11:12 AM