hey all

i am facing a problem and i googled it and didnt find any solutin yet. hope u will help me.
i have web application that support 2 langauges.

i am using CLR. CLR supports a mechanism for packaging and deploying resources with any type of application.

i was able to create resource files for each langauge. the problem is upon using dropdown list to select the langauge that user want the application to view. the value of this dropdown list is always null so the langauge of the application wont change.

here is my code:

protected override void InitializeCulture()
{


string culture = Request.Form["ddl_English"];
// culture var is always null. i cant be able to return the value from dropdownlist.
if (string.IsNullOrEmpty(culture)) culture = "ar-QA";
//Use this
this.UICulture = culture;
this.Culture = culture;
//OR This
if (culture != "ar-QA")
{
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(culture);
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
}
base.InitializeCulture();


}

can any one help me to get the value of the selected item in the dropdown list?

thanks in advance

Recommended Answers

All 2 Replies

string culture = ddl_English.SelectedValue.ToString();

any .net control on a form is accessed directly in code behind so you can get to any of your control's properties.

Hi,
I have same problem as well, I don't know how to fix it. can any one help me, solve this problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.