locked
Displaying Text entered in the TextBox to the Selected Language from DropDownList RRS feed

  • Question

  •  Hi All,
     
    Requiremnet : I have a DropDownList, where user can select any language ,and there is a textbox ,where user enters some text. after entering text in the textbox it should be converted into the user selected language from DropDownList.

    I am able to display the Date or time in selected language...where i'm loading binding all languages to DroopDownList at runtime..
    By these namespaces

    CodeBehind:

        using System.Globalization ;
        using System.Threading;

    public partial class GlobalizationLang : System.Web.UI.Page

    {

        protected void Page_Load(object sender, EventArgs e)

        {

    //loading ddl with languages

    ddlLanguages.Items.Clear();

    foreach (CultureInfo c in CultureInfo.GetCultures(CultureTypes.AllCultures))

    {

    if((c.Name.IndexOf("-")!=-1)&&(c.Name.Contains("-IN")))

    {

    ddlLanguages.Items.Add(c.Name);

    }

    } 

    }

    protected void ddlLanguages_SelectedIndexChanged(object sender, EventArgs e)

    {

    Thread.CurrentThread.CurrentCulture = new CultureInfo(ddlLanguages.SelectedItem.Text);

    txtConverttoLang.Text = DateTime.Now.ToShortDateString();

    // txtConverttoLang.Text = "Chinna Nimmala";      //not able to convert text..

    Response.Write("<h1>"+txtConverttoLang.Text +"<h1>");

    }

    }


    Actual Requirement: I need to Display few selected Languages to DropDownList like Engilsh,Hindhi,French,Telugu... and i have to convert the Textbox entered text into selected language from DDL.

    Thanks in advance for the reply...

    • Moved by nobugz Tuesday, June 10, 2008 6:45 PM Not a BCL question, post to forums.asp.net
    Tuesday, June 10, 2008 3:35 PM

Answers