How to detect a user's culture dynamically?

Posted by Ddd under ASP.NET category on | Points: 40 | Views : 4028
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//add this namespace
using System.Globalization;

public partial class Default3 : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
//How to detect User's Culture dynamically?
string a = Request.UserLanguages[0];
CultureInfo c = new CultureInfo(a);
Response.Write(c.EnglishName + "---" + c.Name);


Comments or Responses

Login to post response