DNN 3.1 Custom module PA - Type ListItem is not defined...

Last post 12-27-2005 12:31 PM by chris6506. 6 replies.

Sort Posts:

  • DNN 3.1 Custom module PA - Type ListItem is not defined...

    12-26-2005, 6:21 PM
    • Member
      30 point Member
    • chris6506
    • Member since 05-13-2005, 10:11 AM
    • Posts 6

       Hi all! I am developing a custom module in DNN 3.1. I have the framework in place and everything compiles and displays fine in the portal. My problem is that the module needs to hit the database then based on the results, dynamically add other controls to the page (textnboxes, dropdown lists, etc.) I can dynamically add a dropdown list but when I go to populate it with the following code...

                        Dim objListItem As ListItem
                        While drModelCampaignExclusions.Read()
                            objListItem = New ListItem
                            objListItem.Value = drModelCampaignExclusions("Control_ID")
                            objListItem.Value = drModelCampaignExclusions("Display")
                            cblModelCampaignExclusions.Items.Add(objListItem)
                        End While

    I find that the ListItem does not appear in the intellisense. Under the first line of code I get the error Type 'ListItem' is not defined. Is there something I am missing or going about the wrong way? Any pointers would be greatly appreciated.

    Thanks!

    Chris

  • Re: DNN 3.1 Custom module PA - Type ListItem is not defined...

    12-26-2005, 6:57 PM
    • All-Star
      16,504 point All-Star
    • hooligannes97
    • Member since 09-26-2003, 2:57 PM
    • Bolivia
    • Posts 2,917
    • Moderator
    make sure that the library that contains ListItem has been referenced properly.
    Do you know the truth when you hear it?
  • Re: DNN 3.1 Custom module PA - Type ListItem is not defined...

    12-27-2005, 8:59 AM
    • Member
      30 point Member
    • chris6506
    • Member since 05-13-2005, 10:11 AM
    • Posts 6

    Thanks for the response.

    In a regular .aspx page, the class inherits using Inherits System.Web.UI.Page. In my DNN page it inherits using Inherits Entities.Modules.PortalModuleBase. As VB.net does not allow for multiple inheritance, is there a way to access the ListItem object which is part of the System.Web.UI.Page class?

    Thanks for your help.

    Chris

  • Re: DNN 3.1 Custom module PA - Type ListItem is not defined...

    12-27-2005, 9:06 AM
    • All-Star
      16,504 point All-Star
    • hooligannes97
    • Member since 09-26-2003, 2:57 PM
    • Bolivia
    • Posts 2,917
    • Moderator
    Use the Imports keyword.
    Do you know the truth when you hear it?
  • Re: DNN 3.1 Custom module PA - Type ListItem is not defined...

    12-27-2005, 9:16 AM
    • Member
      30 point Member
    • chris6506
    • Member since 05-13-2005, 10:11 AM
    • Posts 6

    I just tried this...

    Imports System.Web.UI.Page

     and it failed as well. Thanks for your time though.

    Chris Stewart

  • Re: DNN 3.1 Custom module PA - Type ListItem is not defined...

    12-27-2005, 9:31 AM
    • All-Star
      16,504 point All-Star
    • hooligannes97
    • Member since 09-26-2003, 2:57 PM
    • Bolivia
    • Posts 2,917
    • Moderator
    ListItem for the dropdownlist is inside System.Web.UI.WebControls
    Do you know the truth when you hear it?
  • Re: DNN 3.1 Custom module PA - Type ListItem is not defined...

    12-27-2005, 12:31 PM
    • Member
      30 point Member
    • chris6506
    • Member since 05-13-2005, 10:11 AM
    • Posts 6

    That fixed my problem. Thank you very much for your help! :-)

    Chris

Page 1 of 1 (7 items)