Login  Register 
Home
 
Applications
 
Consulting
 
Design
 
Business Links
 
Support
 
Contact
  Search
Search
 
 SupportKnowledge Base     May 17, 2012  
Snippets
02

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);
 }
  
}

Post Rating

Comments

There are currently no comments, be the first to post one.

Post Comment

Only registered users may post comments.
 

P.O. BOX 2342 ~ BREWSTER, MA 02631
PHONE & FAX: (508) 714-0678

 
 Copyright 2012 by Global Internet Business Solutions   Terms Of Use  Privacy Statement