?
Solved

adding localization in master page

Posted on 2012-04-11
1
Medium Priority
?
310 Views
Last Modified: 2012-05-30
I would like to access this code from my pages that belong to this master page........
How Can I do so all i would have to do is to call for loadstring function on my regular pages?



'this code is right below declaration of class
    Private rm As ResourceManager

'my page load code
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim ci As CultureInfo

        If Not Page.IsPostBack Then
            Thread.CurrentThread.CurrentCulture = New CultureInfo("en-US")
            'get the culture info to set the language
            rm = New ResourceManager("Resources.Strings", _
            System.Reflection.Assembly.Load("App_GlobalResources"))
            ci = Thread.CurrentThread.CurrentCulture
            LoadStrings(ci)
        Else
            'get the culture info to set the language
            rm = New ResourceManager("Resources.Strings", _
                 System.Reflection.Assembly.Load("App_GlobalResources"))
            ci = Thread.CurrentThread.CurrentCulture
            LoadStrings(ci)
        End If
        ' If Not IsPostBack Then FillList()

    End Sub

'my load string
    Private Sub LoadStrings(ByVal ci As CultureInfo)

        '  lblwelcome.Text = rm.GetString("welcome", ci)
        lblcust2.Text = rm.GetString("customer", ci)
        lblcust3.Text = rm.GetString("customer", ci)
        lblname.Text = rm.GetString("name", ci)
        lblname2.Text = rm.GetString("name", ci)
        lblterms2.Text = rm.GetString("terms", ci)
        lblshipvia2.Text = rm.GetString("shipvia", ci)
        lblquote.Text = rm.GetString("order", ci)
    End Sub
0
Comment
Question by:Wigging
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 37835330
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question