Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please tell me how I can use my vb.net project and asp.net web site language when I have installed two languages.
One is English and second is Urdu so I want to use Urdu as default language when page load.
Posted
Updated 7-Oct-10 21:47pm
v2
Comments
Dalek Dave 8-Oct-10 3:47am    
Edited for Grammar and Readability.

If you mean how can you make your web pages display in Urdu then...

The .NET runtime checks the System.Threading.Thread.CurrentThread.CurrentUICulture property when deciding what resource file to use.

An example of setting an aspx page's culture can be found here

After you've set the page's language, any strings that you want to be localized should be stored in .resx files. Your resx files need to be named according to the language that they use, so for example:

Default.aspx.resx [your default resource file for Default.aspx]
Default.aspx.es.resx [Spanish version]

It's important that the file names are the same except for the language code and also the language code must be just before the .resx


on your aspx page (and in your code-behind), the contents of the resource files listed above could be accessed as
Resources.Default.aspx.<string name from the resx file>


So, your aspx might have something like...
<H2><%=Resources.Default.aspx.pagetitle %></H2>


and if the page's culture is set to Spanish, then it would use the string from Default.aspx.es.resx instead of Default.aspx.resx

I hope this helps :)
 
Share this answer
 
v3
 
Share this answer
 
Comments
Simon_Whale 8-Oct-10 11:02am    
thanks for a good bookmark :))

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