Resources

H

Heinrich Moser

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
 
G

George Ter-Saakov

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.
 
C

Cowboy \(Gregory A. Beamer\)

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.
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top