:: Professional ::
 
You are here: Blog
 

Hilbert Solutions, LLC Latest Dotnetnuke Modules...

Advanced News Ticker        Constant Contact Sign Up

 

Blog
Apr2

Written by:slhilbert
4/2/2009 3:00 PM 

Today I needed to grab the values of a list I have setup in Dotnetnuke
and display it in a dropdownlist.  The code to do this is really quite
simple.

'List controller grants us access to the function that we can use to get the list.
Dim lc As New DotNetNuke.Common.Lists.ListController()

'Databinding a list called, "Country" to the dropdownlist.
Me.ddlCountry.DataSource = lc.GetListEntryInfoCollection("Country")
Me.ddlCountry.DataTextField = "Text"
Me.ddlCountry.DataValueField = "Value"
Me.ddlCountry.DataBind()

Me.ddlCountry.Items.Insert(0, "-Select a Country-")

 

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment  Cancel 
Search Blog
Blog Archive
Terms Of Use| Privacy Statement Hilbert Solutions, LLC Since 2007