Resource Files & globalization

Discussion in 'ASP .Net' started by John Stemper, Dec 2, 2003.

  1. John Stemper

    John Stemper Guest

    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
     
    John Stemper, Dec 2, 2003
    #1
    1. Advertising

  2. 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.
     
    Jacob Yang [MSFT], Dec 3, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dirc Khan-Evans
    Replies:
    1
    Views:
    914
    Karl Seguin
    Oct 17, 2005
  2. avishosh
    Replies:
    2
    Views:
    10,624
    avishosh
    Aug 8, 2004
  3. Jackie
    Replies:
    3
    Views:
    521
    rossum
    Jan 28, 2006
  4. Heinrich Moser
    Replies:
    1
    Views:
    467
    Heinrich Moser
    Mar 27, 2008
  5. Ole Hanson

    <scr> tag and image files embedded in resource files? (how)?

    Ole Hanson, Jan 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    185
    Steve C. Orr [MVP, MCSD]
    Jan 10, 2005
Loading...

Share This Page