Programmatically Accessing Browser Default Culture

J

jeffmagill

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
 
B

bruce barker \(sqlwork.com\)

asp.net looks at the Accept-Encoding and Accept-Language headers the browser
(optionally) sends on a request..

-- bruce (sqlwork.com)
 
J

jeffmagill

Thanks a lot Bruce! I will give that a look.
asp.net looks at the Accept-Encoding and Accept-Language headers the browser
(optionally) sends on a request..

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top