Solved

Reading the Accept-Language header in the code behind

Posted on 2012-03-21
3
384 Views
Last Modified: 2012-03-21
Does anyone have a code snippet for reading the Accept-Language from the HTTP header in the code behind file?
0
Comment
Question by:LarsNess
3 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 37746541
Does this article help you further ?
ASP.NET Request.Headers
http://www.dotnetperls.com/request-headers
0
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37746638
use this inside your code behind file:-
Request.Headers["Accept-Language"].ToString();
0
 

Author Closing Comment

by:LarsNess
ID: 37746642
Brilliant!

For those of you who are interested, I found the Accept-Language like this:

            NameValueCollection headers = base.Request.Headers;
            string acceptLanguage = headers.Get("Accept-Language");
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question