Dreamweaver using .resource files

Discussion in 'ASP .Net' started by Daniel, May 29, 2007.

  1. Daniel

    Daniel Guest

    I am just investigating on .resx and .resource files using asp.net. I
    am attempting to develop a webpage in Dreamweaver on an asp.net
    webserver. As i read around the net, using a .resource file for all
    my text on my website seems like the best way to go. I would just
    have a fr.resource file for each language. This seems like it would
    work pretty well. I have been able to create the .resource files but
    i do not know how to read them to put on my website. Most of the
    information i have been reading explains how to do this with VBstudio,
    but i am using dreamworks. Can someone point me in the right
    direction?
    Daniel, May 29, 2007
    #1
    1. Advertising

  2. If this is page by page, you do the following:

    1. Create a directory called App_LocalResources
    2. Name the resource file for default.aspx default.aspx.resx
    3. Use the following tag to get the value Header from this file (assuming a
    name of HeaderText)

    <%$ Resources:HeaderText %>

    as in

    <h1><asp:Label runat="server" Text="<%$ Resources:HeaderText %>"
    id="Label3"/></h1>

    For global resources

    1. Create a directory called App_GlobalResources
    2. Name the file something like GlobalResources.resx (name not as important
    as matching the file name to the class name in the next step)
    3. Use the following tag (note the GlobalResources class name as this is the
    major change from local resources)

    <%$ Resources:GlobalResources, HeaderText %>

    as in

    <h1><asp:Label runat="server" Text="<%$ Resources:GlobalResources,
    HeaderText %>" id="Label3"/></h1>

    Rule: ClassName = RESX file name.

    If you do this, ASP.NET can be set up to automatically localize content when
    you have the proper language resource files. You will have to add a
    globalization tag to the web.config.

    For a great intro, find Michele Leroux Bustamante's articles on MSDN. You
    can also find her blog at www.dasblonde.com.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com
    Co-author: Microsoft Expression Web Bible (upcoming)

    ************************************************
    Think outside the box!
    ************************************************
    "Daniel" <> wrote in message
    news:...
    >I am just investigating on .resx and .resource files using asp.net. I
    > am attempting to develop a webpage in Dreamweaver on an asp.net
    > webserver. As i read around the net, using a .resource file for all
    > my text on my website seems like the best way to go. I would just
    > have a fr.resource file for each language. This seems like it would
    > work pretty well. I have been able to create the .resource files but
    > i do not know how to read them to put on my website. Most of the
    > information i have been reading explains how to do this with VBstudio,
    > but i am using dreamworks. Can someone point me in the right
    > direction?
    >
    Cowboy \(Gregory A. Beamer\), May 30, 2007
    #2
    1. Advertising

  3. Daniel

    Daniel Guest

    That didn't work for me. My site just displayed "<%$
    Resources:GlobalResources,
    HeaderText %>" in <h1> format. My asp server compiles other code. Do
    you know what the problem could be?
    thanks!
    Daniel, Jun 11, 2007
    #3
    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:
    881
    Karl Seguin
    Oct 17, 2005
  2. Jason
    Replies:
    25
    Views:
    8,463
    Toby Inkster
    Jan 9, 2005
  3. avishosh
    Replies:
    2
    Views:
    10,525
    avishosh
    Aug 8, 2004
  4. Jackie
    Replies:
    3
    Views:
    504
    rossum
    Jan 28, 2006
  5. Heinrich Moser
    Replies:
    1
    Views:
    447
    Heinrich Moser
    Mar 27, 2008
Loading...

Share This Page