public class Country
{
int id;
string countryName;
public int ID
{
get { return id; }
}
public string CountryName
{
get { return countryName; }
set { countryName = value; }
}
}
List
objCountry = objCountry.FetchCountries();
ddlCountryList.DataSource = objCountry;
ddlCountryList.DataTextField = "CountryName";
ddlCountryList.DataValueField = "ID";
ddlCountryList.DataBind();
The ddlCountryList is an asp.net drop down list control.
No comments:
Post a Comment