Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there
suppose there are two TextBoxs.
TextBox1 only accept "English" language
&
TextBox2 only accept "Hindi" (Indian Language)

==
Windows user having option to change the keyboard input language from English to Hindi
but every time language changing may be so irritating for user.

So i just want to know is there any way for this?
Language must automatically change as user enter in TextBox.

What I have tried:

i TRIED THIS -- Event fire on Language dropdown index changed

// for english
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us");

// for Hindi
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("hi-IN");



but it's not working
Posted
Updated 10-Mar-16 1:09am
Comments
Richard Deeming 8-Mar-16 6:57am    
Try setting lang="en-US" on TextBox1, and lang="hi-IN" on TextBox2. That will at least make sure the browser's spell-check uses the correct language for each box. I'm not sure whether it will automatically switch keyboard layouts as well.

Setting the CurrentCulture won't affect the textboxes in a web based application - C# code only executes at the server and doesn't influence the client browser at all.
You either need to use Javascript (and I have never even tried changing language with that) or use the HTML as suggested by Richard Deeming.

But no C# Culture change will affect either textbox in the slightest.
 
Share this answer
 
The solution by Richard was not working. Even, as per my knowledge, language to be choose for writing is browser and alternatively OS based. So, its better to go for some browser settings using browser file in ASP.NET.

Another option is to suggest user to use universal language settings for Hindi language provided by Microsoft. This option was available in Regional and language settings.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900