Solved

adding localization in master page

Posted on 2012-04-11
1
302 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
Comment Utility
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now