Doubt on Multilingual application

A

amitmnagarwal

I am using the following code to access the resourc file.

Dim sAssembly As [Assembly]
sAssembly = [Assembly].GetExecutingAssembly()

Dim rm As New ResourceManager("MultiLingual.Info",
sAssembly)

''Case sensitive
Response.Write(rm.GetString("Test"))
Response.Write("<br><br>" & rm.GetString("Test1"))

This code would reside in a common place where the whole application
would require the info from the resource file.

I wanted to know that if i create the instance of the resourcemanager
at application level in the application start event and let the code
reference the application object.

This would avoid callling the above code repeatedly

Please advice
 
C

Chris Fulstow

Probably not a good idea because more than one thread might try to use
you ResourceManager object at the same time, so you could run into
concurrency problems.
 
R

Robert Haken [MVP]

When localizing ASP.NET web applications, you should use

<%$ Resources: .... %> expressions in markup,
Resources (generated namespace),
HttpContext.GetGlobalResourceObject() method (available also in Page)
and HttpContext.GetLocalResourceObject() method (available also in Page).

There is usually no need to use ResourceManager.

Robert Haken [MVP ASP/ASP.NET]
HAVIT, s.r.o., www.havit.cz
http://knowledge-base.havit.cz
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top