473,409 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Programmatically Accessing Browser Default Culture

Hi everyone!

As the title says, I'm to access the default culture for the browser at
run time. Furthermore as some side notes, my application's goal is to
accomplish this at the application level and also the language will be
saved in a profile.

I know there must be a way to do this because the page directive can be
set with the members Culture="auto" and UICulture="auto". This is the
functionality that I am trying to accomplish though it doesn't solve
my problem because by doing so, it overrides any my profile code from
the global.asax.

I feel like I am not being entirely clear and I'm lacking the words to
explain myself so here is some pseudo code of what I'm trying to
accomplish. Really the first block is what I am interested in.

if profile.culture = "" then
set language to default-browser-language

else if profile.culture = "en-US" then
set language to english

else if profile.culture ="es" then
set language to spanish

end if

Thanks in advance!
Jeff

Jun 6 '06 #1
2 1984
asp.net looks at the Accept-Encoding and Accept-Language headers the browser
(optionally) sends on a request..

-- bruce (sqlwork.com)
<je********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hi everyone!

As the title says, I'm to access the default culture for the browser at
run time. Furthermore as some side notes, my application's goal is to
accomplish this at the application level and also the language will be
saved in a profile.

I know there must be a way to do this because the page directive can be
set with the members Culture="auto" and UICulture="auto". This is the
functionality that I am trying to accomplish though it doesn't solve
my problem because by doing so, it overrides any my profile code from
the global.asax.

I feel like I am not being entirely clear and I'm lacking the words to
explain myself so here is some pseudo code of what I'm trying to
accomplish. Really the first block is what I am interested in.

if profile.culture = "" then
set language to default-browser-language

else if profile.culture = "en-US" then
set language to english

else if profile.culture ="es" then
set language to spanish

end if

Thanks in advance!
Jeff

Jun 7 '06 #2
Thanks a lot Bruce! I will give that a look.

bruce barker (sqlwork.com) wrote:
asp.net looks at the Accept-Encoding and Accept-Language headers the browser
(optionally) sends on a request..

-- bruce (sqlwork.com)
<je********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hi everyone!

As the title says, I'm to access the default culture for the browser at
run time. Furthermore as some side notes, my application's goal is to
accomplish this at the application level and also the language will be
saved in a profile.

I know there must be a way to do this because the page directive can be
set with the members Culture="auto" and UICulture="auto". This is the
functionality that I am trying to accomplish though it doesn't solve
my problem because by doing so, it overrides any my profile code from
the global.asax.

I feel like I am not being entirely clear and I'm lacking the words to
explain myself so here is some pseudo code of what I'm trying to
accomplish. Really the first block is what I am interested in.

if profile.culture = "" then
set language to default-browser-language

else if profile.culture = "en-US" then
set language to english

else if profile.culture ="es" then
set language to spanish

end if

Thanks in advance!
Jeff


Jun 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kj | last post by:
How does one trigger an event programmatically? I'm interested in how to do this in both the "Level 0" event model as well as in the DOM Level 2 event model. Thanks! kj -- NOTE: In my...
1
by: Sreekanth | last post by:
Hi, I am trying to globalize my application by separating out all the strings into resource files. For testing purpose, I have created two resource files. MyApp.resx, MyApp.en-US.resx. These resx...
5
by: Helen | last post by:
Hi, I am trying to write an ASP.Net application that integrates with a third party application via their fairly simplistic web component, however I am having problems with the URI. The URI...
0
by: Roger Helliwell | last post by:
Hey all, Our web app (.NET 2.0 beta 1) uses the web.config to store site-wide settings. Most of these settings are in the <appSettings> section and getting at them at runtime is a snap by using...
4
by: Kaush | last post by:
Hi all, I am creating a webservice to accept SOAP messages, parse the message and send a SOAP response back to the client accessing my web service using WSE-2 in ASP.NET. I am creating a class...
20
by: Tim Reynolds | last post by:
Team, I am developing a web service. In testing in on my enw PC, I am expecting to see exceptions thrown appear on my browser. Instead I am getting an HTTP 500 Internal Server Error page and I am...
12
by: =?Utf-8?B?RnJlZU5FYXN5?= | last post by:
Hello, the scenario: There's an ASPX page which shows some text and has three buttons at the bottom: Save, Print and Close. Print and close is done by javascript. But how can I save the page...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
2
ssnaik84
by: ssnaik84 | last post by:
Hello, I have hosted a website on GoDaddy.com. It's a share hosting. I am using XML file as a database. That means, I am reading and writing data into XML file instead of regular RDBMS (MySQL, MS...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.