Solved

adding localization in master page

Posted on 2012-04-11
1
306 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
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37835330
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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