---
title: "Displaying User Culture Language in ASP.Net"  
description: "Hey Guys!! In this tutorial, I am going to explain you, how to read user’s cultural language and redirect the user’s page according to that regional/c"  
author: "mohan kumar"  
published: 2011-11-21  
updated: 2017-11-30  
canonical: https://www.mindstick.com/articles/808/displaying-user-culture-language-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Displaying User Culture Language in ASP.Net

Hey Guys!! In this tutorial, I am going to explain you, how to read user’s cultural language and redirect the user’s page according to that regional/country language.\

My Concept: - Both the request object’s User Languages and the CulturalInfo class’s Name property return culture information into two parts. The first two letters are the language code. Depending upon the language code, I will be redirecting the user according to his/her regional/Country language.

##### Default.aspx:-

```
<form id="form1" runat="server">    <div>    <asp:Label ID="lblCulture" runat="server" ></asp:Label>    </div></form>
```

(However,I am not going to use this label..Let it be there J J)

##### Default.aspx.cs:-

Don’t forget to add the namespace System.Globalization. Use VB Or C# use this lines to add the namespace.

Using System.Globalization; (C#)

Import System.Globalization (VB)

```
using System;using System.Collections;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Globalization; public partial class Default2 : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {        //Get the user's preferred language        string sLang =Request.UserLanguages[0];        //Get the first two characters of the language        sLang= sLang.Substring(0, 2);       //Redirect user based culture        switch (sLang)        {            case "en":                //use US Site                Response.Redirect("http://www.mindstick.com/lang/eng");                break;            case "es":                //use Spanish Site                Response.Redirect("http://www.mindstick.com/lang/es");                break;            case "de":                //use German Site                Response.Redirect("http://www.mindstick.com/lang/de");                break;            case "zh":                //use Chinese Site                Response.Redirect("http://www.mindstick.com/lang/zh");                break;            default:                Response.Redirect("http://www.mindstick.com/lang/eng");                break;        }    }}
```

On running this sample code,you will be directly redirected to the corresponding language.Just post back a reply if this article was useful for you. Thanks for reading my article. Happy Coding.Explore more and more as much as possible.

\

---

Original Source: https://www.mindstick.com/articles/808/displaying-user-culture-language-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
