using global.asax to change sitewide labels

Results 1 to 2 of 2

Thread: using global.asax to change sitewide labels

  1. #1
    Join Date
    Dec 1969

    Default using global.asax to change sitewide labels

    I&#039;m trying to figure out how to use the Session_Start request in the global.asax file to set sitewide asp:labels to a certain variable.<BR><BR>We are making a site "translatable" into multiple languages. Everywhere on the site that contains text was converted to asp:labels so we could dynamically fill each one with whatever language the user selects. Below is an example we coded into one page for the navigation but how can we do this site wide without programming every single page?:<BR><BR>//-----<BR>if ((String)Session["UserLanguage"] == "spanish")<BR> {<BR> lblJobs.Text="Trabajos";<BR> lblLocations.Text="Localizaciones / Encargados";<BR> lblUsers.Text="Usuarios";<BR> lblOccupational.Text="Llaves Ocupacionales";<BR> lblTally.Text="Cuentas De la Cuenta";<BR> lblHome.Text="Casero";<BR> lblSignout.Text="Muestra hacia fuera";<BR> lblContact.Text="Contacto:";<BR> lblCustomerSupport.Text="Ayuda de Cliente";<BR> lblTechnicalSupport.Text="Ayuda de Tech";<BR> }<BR> if ((String)Session["UserLanguage"] == "english")<BR> {<BR> lblJobs.Text="Jobs";<BR> lblLocations.Text="Locations / Managers";<BR> lblUsers.Text="Users";<BR> lblOccupational.Text="Occupational Keys";<BR> lblTally.Text="Tally Scores";<BR> lblHome.Text="Home";<BR> lblSignout.Text="Sign Out";<BR> lblContact.Text="Contact:";<BR> lblCustomerSupport.Text="Customer Support";<BR> lblTechnicalSupport.Text="Technical Support";<BR> }<BR> if ((String)Session["UserLanguage"] == "dutch")<BR> {<BR> lblJobs.Text="Banen";<BR> lblLocations.Text="Positionen / Managers";<BR> lblUsers.Text="Benutzer";<BR> lblOccupational.Text="Berufliche Schl├╝ssel";<BR> lblTally.Text="Addieren Sie Kerben";<BR> lblHome.Text="Haupt";<BR> lblSignout.Text="Zeichen heraus";<BR> lblContact.Text="Kontakt:";<BR> lblCustomerSupport.Text="Kundenbetreuung";<BR> lblTechnicalSupport.Text="Techunterst├╝tzung";<BR> }<BR>//-----<BR><BR>Can I use a code behind somehow in the global file? Can anyone point me in the right direction? <BR><BR>Thanks I appreciate it.<BR><BR>Aaron<BR>

  2. #2
    Join Date
    Dec 1969

    Default sorry to say

    that is an absolutely horribly way to do it....<BR><BR>ever look into "localization"?<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts