In my project for adding details to the profile, i need 3 dropdown list to choose country then another dropdown to choose its corresponding states then its city.. is there any dll available for this?? how to implement this in visual studio 2010?? Can't use database here coz have to store lot of details..
help me please..
Sanjeeb LenkaPosted Aug 1, 2013, 4:53 AM
yes you can do it. its available in .net. but you can only get the Country.
ex:
in aspx code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
in .cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DropDownList1.DataSource = CountryList();
DropDownList1.DataBind();
}
}
public static List
{
//Creating list
List
//getting the specific CultureInfo from CultureInfo class
CultureInfo[] getCultureInfo = CultureInfo.GetCultures(CultureTypes.SpecificCultures);
foreach (CultureInfo getCulture in getCultureInfo)
{
//creating the object of RegionInfo class
RegionInfo GetRegionInfo = new RegionInfo(getCulture.LCID);
//adding each county Name into the arraylist
if (!(CultureList.Contains(GetRegionInfo.EnglishName)))
{
CultureList.Add(GetRegionInfo.EnglishName);
}
}
//sorting array by using sort method to get countries in order
CultureList.Sort();
//returning country list
return CultureList;
}
}
or you can download the attached sample and check.
Sanjeeb LenkaPosted Aug 1, 2013, 5:38 AM
iswarya chandranPosted Aug 1, 2013, 5:36 AM
Sanjeeb LenkaPosted Aug 1, 2013, 5:28 AM
mark it as answered if it helps you...
iswarya chandranPosted Aug 1, 2013, 5:26 AM
Posted Aug 1, 2013, 4:38 AM
iswarya chandranPosted Aug 1, 2013, 4:23 AM
is there any microsoft ddl for providing this information???
Riyaz AkhtarPosted Jul 31, 2013, 11:22 AM
http://forums.asp.net/t/1678202.aspx/1?country+and+States#4406645
Posted Jul 31, 2013, 9:58 AM
http://www.aspdotnet-suresh.com/2010/10/how-to-populate-dropdown-based-on-other.html