Using DotNetNuke lists (c# included)

Published Wednesday, February 07, 2007 7:32 PM

A quick update for using DotNetNuke's built in List functionality.

If you're logged in as a HOST you can create new lists from the HOSTS/LISTS menu.

If you want to access lists programatically? Here's some simple code for doing so, this uses the included United States region (States) list. In C# of course.

import DotNetNuke.Common.Lists;

using

then use the following in your code

ListController lc = new ListController();

ListEntryInfoCollection leic = lc.GetListEntryInfoCollection("Region","","Country.US");

ddlStates.DataTextField = "Text";

ddlStates.DataValueField = "Value";

ddlStates.DataSource = leic;

ddlStates.DataBind();

ddlStates.Items.Insert(0, new ListItem("Select State", "-1"));

 

Pretty simple! now get to it!

Comments

# DotNetNuke Developer : Using DotNetNuke lists (c# included) said on Friday, February 09, 2007 8:55 AM

PingBack from http://weblogs.asp.net/christoc/archive/2007/02/07/using-dotnetnuke-lists-c-included.aspx

# AJ said on Sunday, July 15, 2007 3:13 AM

Awesome. I always used to wonder about how to use those lists programmatically. Thank you.

# Shreekala said on Wednesday, January 16, 2008 5:11 AM

How to add external data to a list in DotNetNuke lists

ListController lc = new ListController();

ListEntryInfoCollection leic = lc.GetListEntryInfoCollection("Region","","Country.US");

I want to add one more item to

leic

how to do?

# Chris Hammond said on Saturday, January 19, 2008 11:00 PM

Do you want to add it programatically or into the database?

# kiran said on Tuesday, August 12, 2008 7:30 AM

How to add external data to a list in DotNetNuke lists

ListController lc = new ListController();

ListEntryInfoCollection leic = lc.GetListEntryInfoCollection("Region","","Country.US");

I want to add one more item to

leic

how to do?

I want to add it into the database?

# Tecnologías en general said on Thursday, October 16, 2008 5:16 AM

En DNN desde el apartado de Host podemos crearnos nuestras propias listas. Peeero, ¿como podemos usarlas programáticamente?. Pues muuuuu facil: import DotNetNuke.Common.Lists; ListEntryInfoCollectio ...

This Blog

Syndication