calendar control language?

R

rom

in visual studio.net when i watch/design the calendar
control on the design view i see the days/months in my
language(hebrew) but on the web is generates it into
english. any way to solve this problem?
 
K

Ken Cox [Microsoft MVP]

Hi,

At runtime, the calendar control picks up the culture info from the server.
You can override the default behaviour by setting the culture of the thread
the calendar is on:

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim ci As System.Globalization.CultureInfo
Dim dtNow As Date = DateTime.Now
Dim strName As String = "he-IL"
System.Threading.Thread.CurrentThread.CurrentUICulture = _
New System.Globalization.CultureInfo(strName, False)
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo(strName)
Calendar1.SelectedDate = dtNow
Calendar1.VisibleDate = dtNow
End Sub

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto
 
R

rom

adding colture in the page line solves the problem:
<%@ Page colture="he-IL" Language="vb"..........
-----Original Message-----
Hi,

At runtime, the calendar control picks up the culture info from the server.
You can override the default behaviour by setting the culture of the thread
the calendar is on:

Private Sub Page_Load _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim ci As System.Globalization.CultureInfo
Dim dtNow As Date = DateTime.Now
Dim strName As String = "he-IL"
System.Threading.Thread.CurrentThread.CurrentUICulture = _
New System.Globalization.CultureInfo(strName, False)
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo(strName)
Calendar1.SelectedDate = dtNow
Calendar1.VisibleDate = dtNow
End Sub

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto


rom said:
in visual studio.net when i watch/design the calendar
control on the design view i see the days/months in my
language(hebrew) but on the web is generates it into
english. any way to solve this problem?

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top