By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

How to load resource files?

P: n/a
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("Re sources",
Server.MapPath("resources") + Path.DirectorySeparatorChar, Nothing)

and

[Application_BeginRequest]
Try
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLang uages(0))
Catch
Thread.CurrentThread.CurrentCulture = New CultureInfo("de-DE")
End Try

Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture

Inside my default.aspx 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!
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.