Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.

Country List With their Culture in ASP.Net

Viewed:  1758 
Posted On:  16/03/2013 08:41:44 
In this article I am going to show how we can show country list with their Country code and language code. 

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" "">
<html xmlns="">
<head runat="server">
    <title>Country List By Their Culture</title>
    <form id="form1" runat="server">
    <table cellpadding="1" cellspacing="1" width="50%" align="center" style="background: skyblue;">
            <td align="center">
                <asp:Button ID="btnGetCountryCulture" runat="server" Text="Get Country~Culture" OnClick="btnGetCountryCulture_Click"
                    BorderStyle="Double" BorderColor="AliceBlue" />
    <div id="Country_Culture_Info" runat="server" style="width: 800px; height: 400px;
        overflow: auto;">
aspx.cs Code:

using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
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("<td>" + item.DisplayName + " </td><td> " + item.Name + "</td>");
        Country_Culture_Info.InnerHtml = get_Info.ToString();

By Yogesh  On  05/04/2013 03:40:26
gud one..
         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us