Snippets
02

Get a list of states using the DNN Lists

public void GetDropDownListStates()

{

 try
 {
  // Get State Dropdown from DNN Lists

var regions = new ListController().GetListEntryInfoItems("Region", "Country.US", this.PortalId);
ddlStatesRecipient.DataTextField = "Value";
ddlStatesRecipient.DataValueField = "Value";
ddlStatesRecipient.DataSource = regions;
ddlStatesRecipient.DataBind();
ddlStatesRecipient.Items.Insert(0, new ListItem("-Select-", "-1"));
ddlStatesRecipient.SelectedValue = "MA";
 

 }

 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.

  120 OLD FREEMANS WAY, BREWSTER, MA 02631
  P. O. BOX 2342, BREWSTER, MA 02631
  (774) 323-3176
  CONTACT US