Tuesday 18 December 2012

globalization in asp.net 4.5 C#

globalization in asp.net 4.5  example.


Step 1)  Create a web project using VS2012 and select .net 4.5


Step 2)  Add folder called   App_GlobalResources 

                 right click on solution add ASP.Net folder  select App_GlobalResources

Step 3) Add  2+1 cultures

  1. English  (default resource/fallback resource)
  2. Germany
  3. France

Step 4)  Add  a WebPage

                dropdown box,   label, button   controls

Step 5)  How to make resource files for each Culture
             add "New item" -> Resource file  i.e Resource.resx
          
               Add  2 String resources  one as TitleOne  second for Globalone  with the following content

                GlobalOne: Globalization is the process of international integration arising from the interchange of world views, products, ideas, and other aspects of culture.[1][2] Put in simple terms, globalization refers to processes that promote world-wide exchanges of national and cultural resources. Advances in transportation and telecommunications infrastructure, including the rise of the Internet, are major factors in globalization, generating further interdependence of economic and cultural activities.[3]
Eastern Telegraph Company 1899 chart of undersea telegraph cabling. An example of modern globalizing technology in the beginning of the 20th century.

Though several scholars place the origins of globalization in modern times, others trace its history long before the European age of discovery and voyages to the New World. Some even trace the origins to the third millennium BCE.[4][5] Since the beginning of the 20th century, the pace of globalization has proceeded at an exponential rate.[6]

In 2000, the International Monetary Fund (IMF) identified four basic aspects of globalization: trade and transactions, capital and investment movements, migration and movement of people and the dissemination of knowledge.[7] Further, environmental challenges such as climate change, cross-boundary water and air pollution, and over-fishing of the ocean are linked with globalization.[8] Globalizing processes affect and are affected by business and work organization, economics, socio-cultural resources, and the natural environment.

TitleOne: Hello
               

Repeat above step for other languages

              for germany  file name must be Resources.de.resx
            GlobalOne : Globalisierung ist der Prozess der internationalen Integration aus dem Austausch von Weltanschauungen, Produkte, Ideen und andere Aspekte der Kultur. [1] [2] in einfachen Worten, bezieht sich die Globalisierung auf Prozesse, die weltweit den Austausch von Förderung der nationalen und kulturellen Ressourcen. Advances in Transport-und Telekommunikations-Infrastruktur, einschließlich der Aufstieg des Internets, sind wichtige Faktoren in der Globalisierung, Generierung weiterer Interdependenz der wirtschaftlichen und kulturellen Aktivitäten. [3]
Eastern Telegraph Company 1899 Diagramm der unterseeischen Telegraphen-Verkabelung. Ein Beispiel der modernen globalisierten Technologie in den Anfang des 20. Jahrhunderts.

Obwohl einige Wissenschaftler die Ursprünge der Globalisierung in der heutigen Zeit zu stellen, verfolgen andere seiner Geschichte lange vor der europäischen Zeitalter der Entdeckungen und Reisen in die Neue Welt. Einige haben sogar die Ursprünge bis ins dritte Jahrtausend v.Chr. [4] [5] Seit dem Beginn des 20. Jahrhunderts, das Tempo der Globalisierung hat mit einer exponentiellen Rate ging. [6]

Handel und Transaktionen, Kapital und Investitionen Bewegungen, Migration und Freizügigkeit von Personen und die Verbreitung von Wissen [7] Weitere, ökologische Herausforderungen wie Klimawandel, Kreuz:. Im Jahr 2000, dem Internationalen Währungsfonds (IWF) vier grundlegende Aspekte der Globalisierung identifiziert -Grenze Wasser-und Luftverschmutzung, und Überfischung der Ozeane sind die mit der Globalisierung verbunden sind. [8] globalisiert Prozesse beeinflussen und werden von Unternehmen und Arbeitsorganisation, Ökonomie, soziokulturelle Ressourcen und der natürlichen Umwelt beeinflusst.


TitleOne           : Hallo


for french :   Resources.fr.resx

Globalone: La mondialisation est le processus d'intégration internationale découlant de l'échange de visions du monde, des produits, des idées, et d'autres aspects de la culture. [1] [2] En termes simples, la mondialisation désigne les processus qui favorisent les échanges mondiaux d'envergure nationale et culturelle ressources. Progrès des transports et des infrastructures de télécommunications, y compris la montée de l'Internet, sont des facteurs majeurs de la mondialisation, l'interdépendance générer davantage d'activités économiques et culturelles. [3]
Est Telegraph Company 1899 diagramme de câblage sous-marin télégraphique. Un exemple de la technologie moderne de mondialisation au début du 20e siècle.

Bien que plusieurs chercheurs placer les origines de la mondialisation dans les temps modernes, d'autres traces de sa longue histoire européenne avant l'âge de la découverte et les voyages vers le Nouveau Monde. Certains vont même jusqu'à retracer les origines de la troisième millénaire avant notre ère. [4] [5] Depuis le début du 20e siècle, le rythme de la mondialisation s'est poursuivie à un rythme exponentiel. [6]

En 2000, le Fonds monétaire international (FMI) a identifié quatre aspects fondamentaux de la mondialisation: le commerce et les transactions, le capital et les mouvements d'investissement, la migration et la circulation des personnes et à la diffusion de la connaissance [7] En outre, les défis environnementaux tels que le changement climatique, croix. -frontière de l'eau et de la pollution de l'air, et la surexploitation de l'océan sont liés à la mondialisation. [8] les processus de mondialisation affectent et sont affectés par l'organisation des entreprises et le travail, l'économie, socio-culturelles des ressources et de l'environnement naturel.

TitleOne:bonjour


Once resource files are completed,.  These has to be included/referenced in   webpage.

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
            onselectedindexchanged="DropDownList1_SelectedIndexChanged"
            meta:resourcekey="DropDownList1Resource1">
            <asp:ListItem Value="en-US" meta:resourcekey="ListItemResource1">English</asp:ListItem>
            <asp:ListItem Value="de-DE" meta:resourcekey="ListItemResource2">Germany</asp:ListItem>
            <asp:ListItem Value="fr-FR" meta:resourcekey="ListItemResource3">French</asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="Button1" runat="server"
                    Text="<%$ Resources:Resource, TitleOne %>"
         />

         <asp:Label ID="Label1" runat="server"       Text="<%$ Resources:Resource, Globalone %>" />


   Step 4)   In  InitCulture  you need to change UI culture for each selection from DropDownList


 protected override void InitializeCulture()
    {
        if (Request.Form["DropDownList1"] != null)
        {
            String selectedLanguage = Request.Form["DropDownList1"];
            UICulture = selectedLanguage;
            Culture = selectedLanguage;

            Thread.CurrentThread.CurrentCulture =
                CultureInfo.CreateSpecificCulture(selectedLanguage);
            Thread.CurrentThread.CurrentUICulture = new
                CultureInfo(selectedLanguage);
        }
        base.InitializeCulture();
    }        


Step 5)   On DropDown Selection Change


 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        InitializeCulture();
    }      


Step 6)  Run the Program/F5



             

No comments:

Post a Comment