Forum
 
ForumForumDiscussions and...Discussions and....Net framework ....Net framework ...HowTo: Get ASP.NET/AJAX to set culture/language/locale information automatically from the browserHowTo: Get ASP.NET/AJAX to set culture/language/locale information automatically from the browser
Previous Previous
 
Next Next
New Post
 18/01/2009 17:31
 
 Modified By RichardHowells  on 05/11/2009 22:26:10

Simple - throw this

<globalization enableClientBasedCulture="true" uiCulture="auto" culture="auto" />

Into the system.web part of your Web.config file. 

If the user's browser is configured correctly (in IE it's Tools | Internet Options then click the Languages button near the bottom of the dialog) ASP .Net will set the current thread's culture information automatically based on the user's preference.

This automatically affects things like the default currency symbols, date conversions and decimal point symbol.

What was that?  Oh you are using AJAX too?  Then you need to add this to the scriptmanager on the page...

...EnableScriptGlobalization="true"...

Cheers,
- Richard
If this post helped you over a problem, or taught you something new, please login and rate it. Ratings are in the drop down in the top left corner
Previous Previous
 
Next Next
ForumForumDiscussions and...Discussions and....Net framework ....Net framework ...HowTo: Get ASP.NET/AJAX to set culture/language/locale information automatically from the browserHowTo: Get ASP.NET/AJAX to set culture/language/locale information automatically from the browser

Forum Usage Guidelines

The forums are a place for all to exchange ideas and techniques, and to post and answer questions.  All are welcome to read, registration is required to post. 

If you learn somthing new, discover or acquire a new technique, then please take a moment to register and rate the post that just helped you.  This site does not send spam and it does not release your personal details.  Full details in the site privacy policy.

We have some simple posting guidelines to keep the forums a pleasant and informative environment.

  • No flames, no trolls
  • No profanity, no racism
  • Site management has the final word on approving or removing any thread, post, or comment
  • English language only please

 

Copyright 2002-15 by Dynamisys Ltd