String literal in a multi lingual Web site served over https and http

Last post 07-06-2009 5:02 PM by cool_vjai. 0 replies.

Sort Posts:

  • String literal in a multi lingual Web site served over https and http

    07-06-2009, 5:02 PM
    • Member
      point Member
    • cool_vjai
    • Member since 07-06-2009, 4:28 PM
    • Posts 1

     I am developing a multi lingual website in ASP.NET2.0, master page contains the header and footer. The content of the header is got from a web service( as html text).

    code to set the culture of the resource/thread:

        ' Handles the Init of the culture for the page

        Protected Overrides Sub InitializeCulture()

            environ = EnvironHelper.GetEnivron(Me, applicationId)

            tempCulture = New CultureInfo(environ.Culture)

             'Set the page to use the requesting browsers culture setting and not the servers default setting

            Thread.CurrentThread.CurrentCulture = tempCulture

            Thread.CurrentThread.CurrentUICulture = tempCulture

             ' Assign the Culture to the Resource Manager

            Resources.GlobalResource.Culture = tempCulture

     End Sub

    overridden the prerender event handler to set the string from Global Resources file.

     Protected Overrides Sub OnPreRender(ByVal e As EventArgs)

       Dim header As Control = Page.Master.FindControl("header")

            If Not header Is Nothing Then

                If TypeOf header Is Literal Then

                    Dim headerLiteral As Literal = DirectCast(header, Literal)

                    headerLiteral.Text = environ.getHeaderHTML().Replace(">Application Name", "> " + Resources.GlobalResource.PageTitle + " ")

                End If

            End If

    End Sub

    if the application is viewed in http mode, for all the languages(English,Japanese,Chinese,French,Spanish) it is working fine.

    in https mode only english is displayed for the replaced header text. the child pages content are displayed correctly..

     

    Any suggestions..

Page 1 of 1 (1 items)