Resource Files & globalization

J

John Stemper

Getting resource files to work with VS2002 and ASP.Net seems to be a little
flaky. I've added a resource file "strings.resx" to the project. The
properties of the files say Build action = "embedded resource". I've added
the appropriate code to the Global.asax:

protected void Application_Start(Object sender, EventArgs e)
{
Application["CM"] = new
ResourceManager("strings",Assembly.GetExecutingAssembly());
}

I've added the following code to my app:

ResourceManager rm = (ResourceManager) Application["CM"];
dgResults.Columns[1].HeaderText=rm.GetString("Name");


This builds fine but when I try and run it I get the error:

"Could not find any resources appropriate for the specified culture (or the
neutral culture) in the given assembly. Make sure "strings.resources" was
correctly embedded or linked into assembly "AppName". baseName: strings
locationInfo: <null> resource file name: strings.resources assembly:
AppName, Version=1.0.1431.19005, Culture=neutral, PublicKeyToken=null "

Any suggestions or good articles would be appreciated.


Thanks

John
 
J

Jacob Yang [MSFT]

Hi John,

Based on my research and experience, the following information is useful to
you. Please refer to it carefully.

ResourceManager and ASP.NET
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials
/html/resourcemanager_and_asp_net.asp

Working with Resource Files
http://samples.gotdotnet.com/quickstart/aspplus/doc/resourcefiles.aspx

How to read satellite assemblies resources in ASP.NET
http://www.codeproject.com/aspnet/SatResourcesDemo.asp

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top