Resources

Discussion in 'ASP .Net' started by Heinrich Moser, Mar 24, 2008.

  1. Hi!

    What are the advantages/disadvantages of using

    <p><%= Resources.MyGlobalResourceFile.HelloWorld %></p>

    as compared to

    <p><asp:Localize runat="server" Text="<%$ Resources:MyGlobalResourceFile, HelloWorld %>" /></p>

    Both seem to do quite the same. The documentation seems to recommend
    the second one, although the first one looks more elegant to me (less
    code, less server-side controls, IntelliSense auto-completion).

    Are the any good reasons to favor one over the other? (Assuming that
    it is not necessary to change this value in code...)

    Greetings,
    Heinzi
     
    Heinrich Moser, Mar 24, 2008
    #1
    1. Advertising

  2. Second creates the whole object Localize and first does not do it.
    So I would use first since it's more efficient.
    The second way is more object oriented and support more options like
    Theming...


    George.


    "Heinrich Moser" <> wrote in message
    news:...
    > Hi!
    >
    > What are the advantages/disadvantages of using
    >
    > <p><%= Resources.MyGlobalResourceFile.HelloWorld %></p>
    >
    > as compared to
    >
    > <p><asp:Localize runat="server" Text="<%$ Resources:MyGlobalResourceFile,
    > HelloWorld %>" /></p>
    >
    > Both seem to do quite the same. The documentation seems to recommend
    > the second one, although the first one looks more elegant to me (less
    > code, less server-side controls, IntelliSense auto-completion).
    >
    > Are the any good reasons to favor one over the other? (Assuming that
    > it is not necessary to change this value in code...)
    >
    > Greetings,
    > Heinzi
     
    George Ter-Saakov, Mar 24, 2008
    #2
    1. Advertising

  3. The main advantages of the second is that it is consistent with other
    globalization strings. It is also recommended, which suggests it will be
    supported for a long time, although I doubt MS will get rid of simple
    binding. Another advantage is server side control, although it is rare you
    will want to dink around with resource rendering. The Localize control can
    also do other globalization/localization tasks, but that is not a big issue
    with resources files, at least not over all.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    Subscribe to my blog
    http://gregorybeamer.spaces.live.com/lists/feed.rss

    or just read it:
    http://gregorybeamer.spaces.live.com/

    *************************************************
    | Think outside the box!
    |
    *************************************************
    "Heinrich Moser" <> wrote in message
    news:...
    > Hi!
    >
    > What are the advantages/disadvantages of using
    >
    > <p><%= Resources.MyGlobalResourceFile.HelloWorld %></p>
    >
    > as compared to
    >
    > <p><asp:Localize runat="server" Text="<%$ Resources:MyGlobalResourceFile,
    > HelloWorld %>" /></p>
    >
    > Both seem to do quite the same. The documentation seems to recommend
    > the second one, although the first one looks more elegant to me (less
    > code, less server-side controls, IntelliSense auto-completion).
    >
    > Are the any good reasons to favor one over the other? (Assuming that
    > it is not necessary to change this value in code...)
    >
    > Greetings,
    > Heinzi
     
    Cowboy \(Gregory A. Beamer\), Mar 24, 2008
    #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. Mark Kamoski
    Replies:
    1
    Views:
    2,453
  2. Larry Smith

    Trivial resources problem (beginner)

    Larry Smith, Oct 2, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    518
    Scott Manson
    Oct 2, 2003
  3. Alec Solter
    Replies:
    1
    Views:
    507
    Jay B. Harlow [MVP - Outlook]
    Nov 27, 2003
  4. Mikhail Shilkin

    Resources updating

    Mikhail Shilkin, Oct 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    485
    Richard Grimes [MVP]
    Nov 1, 2004
  5. Russell E. Owen
    Replies:
    0
    Views:
    712
    Russell E. Owen
    Sep 8, 2006
Loading...

Share This Page