DNN Expert posted on January 02, 2012 07:31
Get a list of states using the DNN Lists
public void GetDropDownList-States()
{
try
{
// Get State Dropdown from DNN Lists
ListController ctlList = new ListController();
ListEntryInfoCollection vStates = ctlList.GetListEntryInfoCollection("Region", "Country.US", this.PortalId);
// State
ddlStates.DataTextField = "Value";
ddlStates.DataValueField = "Value";
ddlStates.DataSource = vStates;
ddlStates.DataBind();
ddlStates.Items.Insert(0, new ListItem("--", ""));
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}