Solved

adding localization in master page

Posted on 2012-04-11
1
304 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 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

14 Experts available now in Live!

Get 1:1 Help Now