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..