Solved

Reading the Accept-Language header in the code behind

Posted on 2012-03-21
3
387 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

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…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
Suggested Courses

738 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