How to change asp calender display language

kf 20 Reputation points
2024-04-07T06:03:37.7133333+00:00

User's image

How can i change the display language for the asp calender to english?

I try to check my VS 2022 language pack is only using english.

User's image

Then my edge browser also is in english but the asp calender still display chinese.

User's image

Including the date and time in database also
User's image

It directly display chinese word in asp calender in the design view

User's image

Currently, my whole project is also facing the same issue. But when I transfered the project to another pc, it displayed in english.

How can I change it to display in english?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,396 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,267 questions
{count} votes

Accepted answer
  1. Lan Huang-MSFT 25,636 Reputation points Microsoft Vendor
    2024-04-10T07:09:24.45+00:00

    Hi @kf,

    Currently, my whole project is also facing the same issue. But when I transfered the project to another pc, it displayed in english.

    Based on the latest information you provided, I guess your Windows display language is Chinese?

    If it's in Chinese, maybe you can change it to English.

    Check:

    User's image

    Or you can set the culture to English directly in the page(Culture="en-US" UICulture="en-US").

    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" Culture="en-US" UICulture="en-US" CodeBehind="WebForm1.aspx.cs" Inherits="WebFormDemo.WebForm1" %>

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. SurferOnWww 1,911 Reputation points
    2024-04-08T02:08:14.57+00:00

    Try to set the Culture and UICulture in the @Page directive to "auto" as shown below:

    <%@ Page Language="C#" AutoEventWireup="true" 
        CodeBehind="Calendar.aspx.cs" 
        Inherits="WebForms1.Calendar"
        Culture="auto"
        UICulture="auto" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <h2>Calendar Control</h2>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <p>Default</p>
            <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
        </form>
    </body>
    </html>
    

    When the Preferred Languages is set to give English the first priority and the browser sends the Accept-Language header as shown below;

    enter image description here

    The result will be as follows:

    enter image description here