In this article I am going to show how we can show
country list with their language code.
Below is the output of my program:

Image 1.
My aspx for this:
<%@ Page Language="C#"
AutoEventWireup="true"
CodeFile="Default.aspx.cs"
Inherits="_Default"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Country List By Their Culture</title>
</head>
<body>
<form id="form1" runat="server">
<table cellpadding="1"
cellspacing="1"
width="50%"
align="center"
style="background: skyblue;">
<tr>
<td align="center">
<asp:Button ID="btnGetCountryCulture"
runat="server"
Text="Get Country~Culture"
OnClick="btnGetCountryCulture_Click"
BorderStyle="Double"
BorderColor="AliceBlue"
/>
</td>
</tr>
</table>
<div>
</div>
<div id="Country_Culture_Info"
runat="server"
style="width: 800px; height: 400px;
overflow: auto;">
</div>
</form>
</body>
</html>
aspx.cs
Code:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
sing 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;
using
System.Text;
public partial class _Default :
System.Web.UI.Page
{
protected void
Page_Load(object sender, EventArgs e)
{
}
protected void
btnGetCountryCulture_Click(object sender, EventArgs e)
{
CultureInfo[] culture_Info = CultureInfo.GetCultures(CultureTypes.AllCultures
& ~CultureTypes.NeutralCultures);
StringBuilder get_Info = new
StringBuilder();
get_Info.Append("<table
border=\"1\" width=\"95%\" align=\"center\"
style=\"border:solid 1 black;border-collapse:collapse;background:
#81F7D8\"><tr>
th>Country
Name</th><th>Language-Country code</th></tr>");
foreach (CultureInfo
item in culture_Info)
{
get_Info.Append("<tr>");
get_Info.Append("<td>"
+ item.DisplayName + " </td><td>
" + item.Name + "</td>");
get_Info.Append("</tr>");
}
Country_Culture_Info.InnerHtml = get_Info.ToString();
}
}