开发者

.Net Multilanguage Website

开发者 https://www.devze.com 2023-01-28 18:03 出处:网络
I have a .net we开发者_Go百科bsite in Italian and English. The Italian is in the root, while the English is in a folder (/en). I would like to automatically redirect my non Italian users to the Englis

I have a .net we开发者_Go百科bsite in Italian and English. The Italian is in the root, while the English is in a folder (/en). I would like to automatically redirect my non Italian users to the English version of my website.

how can I do that? Moreover, is it possible to give the chance to override the redirect (i.e. if someone is Italian but has an English browser, can he go back to the Italian version of the website?)

thanks


for me the best way is to show in all pages a button to give the possibility to everyone to swith from a language to another. To check the preferred language set in the browser of the user u can use this: HttpRequest.UserLanguages http://msdn.microsoft.com/en-us/library/system.web.httprequest.userlanguages.aspx

next time u can use the 'localization' ability of the .net ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号