Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reading the Accept-Language header in the code behind

Posted on 2012-03-21
3
Medium Priority
?
412 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 2000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
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.

916 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