Doubt on Multilingual application

Discussion in 'ASP .Net' started by amitmnagarwal@gmail.com, Oct 12, 2006.

  1. Guest

    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
     
    , Oct 12, 2006
    #1
    1. Advertising

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

    wrote:
    > 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
     
    Chris Fulstow, Oct 12, 2006
    #2
    1. Advertising

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

    <> píse v diskusním príspevku
    news:...
    >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
    >
     
    Robert Haken [MVP], Oct 12, 2006
    #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. JoanneC
    Replies:
    0
    Views:
    440
    JoanneC
    Aug 28, 2003
  2. JoanneC
    Replies:
    0
    Views:
    534
    JoanneC
    Aug 30, 2003
  3. Imran
    Replies:
    1
    Views:
    411
  4. bsm
    Replies:
    2
    Views:
    955
  5. raju

    Multilingual application

    raju, Aug 1, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    586
Loading...

Share This Page