Hello Miguel,
One solution would be to put your culture information in the web.config like
this:
<configuration>
<appSettings>
<add key="CI" value="pt-PT" />
</appSettings>
<system.web>
.....
Then, you could retrieve the value in a variable and use the CultureInfo
class to set the language of the calendar:
Public strCI As String
Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
strCI = ConfigurationSettings.AppSettings("CI")
If Not IsPostBack Then
Dim dtNow As Date = DateTime.Now
Dim strName As String = Session("strLanguage")
Thread.CurrentThread.CurrentUICulture = _
New CultureInfo(strCI, False)
Thread.CurrentThread.CurrentCulture = _
New CultureInfo(strCI)
Calendar1.SelectedDate = dtNow
Calendar1.VisibleDate = dtNow
End If
End Sub
Private Sub Calendar1_SelectionChanged _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Calendar1.SelectionChanged
Thread.CurrentThread.CurrentUICulture = _
New CultureInfo(strCI, False)
Thread.CurrentThread.CurrentCulture = _
New CultureInfo(strCI)
End Sub
Does this help?
Ken
Microsoft MVP [ASP.NET]
Toronto
"Miguel Dias Moura" <in************@27lamps.com> wrote in message
news:u$**************@TK2MSFTNGP11.phx.gbl...
Hello,
i have a Calendar Control in my web site and when it's in my computer the
months and weekdays are in portuguese.
When i change it to my server the months and weekdays change to english.
Do you think i can solve this by changing culture in my web.config file?
If yes, can you tell me what should be the code to include in the
web.config
file to force my culture to portuguese?
If no, can you tell me what should be the solution?
Thank You,
Miguel