Solved

Reading the Accept-Language header in the code behind

Posted on 2012-03-21
3
389 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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.

734 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