Asp code in XHTML displays English, then switches to a different language

Discussion in 'C#' started by mboston, Jan 16, 2008.

  1. #1
    Hello, I have the following asp code inserted in an XHTML file:

    <%Response.Write(FormatDateTime(Date, 1)) %>
    Code (markup):

    It works fine for a few minutes, & displays the date in English, but then after visiting other pages on the site, it changes to a different language. Activity seems to cause it to occur, as I stayed on the index.asp for a few hours & it stayed English. Then after a few moments of visiting other pages it switched again. Once it switches, all pages with the same code display it in that language, even ones that moments earlier displayed it in English. It happens in both IE & FireFox. The pages are coded with XHTML 1, & given an asp extension.

    This is the doctype & language info:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "(URL address blocked: See forum rules)">
    <html xmlns="(URL address blocked: See forum rules)" xml:lang="en" lang="en">
    Code (markup):
    Thanks,

    Mark
     
    mboston, Jan 16, 2008 IP
  2. leebari

    leebari Peon

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Web server date is controlled via asp session.

    Place this line at the top of your ASP page to set server locale to English:

    Session.LCID = 1033

    You must have similar line in some of your pages, it changes the language and this change persists in session for other web pages.
     
    leebari, Dec 4, 2009 IP