Globalization and Localization

Ravi Verma 1 Reputation point
2022-05-22T13:57:23.677+00:00

In this code Str getting null value on page load and also on clicking Dropdown. how to solve this problem?

protected override void InitializeCulture()
{
base.InitializeCulture();
string str = Request["DropDownList1"];
if (str != null)
{
UICulture = str;
Culture = str;
}
}

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,251 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,066 Reputation points
    2022-05-23T06:13:07.313+00:00

    Hi @Ravi Verma ,
    Where do you write these codes? First, I think you need this:

    Request.Form["DropDownList1"]  
    

    And then InitializeCulture() are fired before page load. So, if you want to get the value, you need bind the data before InitializeCulture().

    Best regards,
    Yijing Sun


    If the answer is helpful, please click "Accept Answer" and upvote it.

    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.

    0 comments No comments