-
May 2nd, 2008, 03:56 PM
#1
Thread Starter
New Member
culture value in javascript
hi i was wondering how i can get the pages culture value with javascript code. I can set the culture in the VB backend for the site just fine. But i don't know how to check the value of the culture being called ("en-CA / fr-fr") in my javascript. I am aiming to change my sites CSS script depending on the culture value but first i need to check what it is.
OR i can do this on the page load in the backend via VB code, but in that section i don't know how to change the CSS for all the page.
So for a answer i either need to know how to :
-Check the culture Value in javascript
OR
-Change all the page's CSS in VB code
-
May 2nd, 2008, 04:13 PM
#2
Re: culture value in javascript
Because you can detect the user's current culture in the codebehind, you can dynamically set the CSS file to use by creating an HtmlGeneric control, set the tag to "link", rel to "stylesheet" and href to the path of the CSS file based upon the culture that you have. Then, add that to the Page.Head of the page.
-
May 2nd, 2008, 04:29 PM
#3
Thread Starter
New Member
Re: culture value in javascript
ya thats the problem i'm having though i'm not sure how to check what culture it currentally is using so i can change the href link to the css sheet.
-
May 3rd, 2008, 03:20 AM
#4
Re: culture value in javascript
Check either Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"] or Request.UserLanguages.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|