Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Ads  
 


  Sponsors  

Meet Our Sponsors

WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Binding to Dropdownlist
Previous Previous
 
Next Next
New Post 10/8/2007 8:09 PM
User is offline dwong
16 posts
10th Ranked


Binding to Dropdownlist 

Hi,

I'm very new with ASP.NET, and DNN. I'd greatly appreciate your patience with me, and help me out here.
I'm building my own module, and have problems trying to bind data to my dropdownlist.
Here's a snapshot/extract of what I have done.

  1. Stored Procs:
    • I've created a Storedprocedure "YourCompany_MyModule_GetCategories"
    • CREATE PROCEDURE {databaseOwner}[{objectQualifier}YourCompany_MyModule_GetCategories]
      (
      @ModuleID int
      )
      AS
      SELECT CategoryID, CategoryName, CategoryDesc
      FROM {objectQualifier}YourCompany_MyModule_Categories
      WHERE (ModuleID = @ModuleID)
      order by CategoryName
      RETURN
  2. App_Code\MyModule\SqlDataProvider.vb:
    • Public Overrides Function YourCompany_MyModule_GetCategories(ByVal ModuleId As Integer) As IDataReader
      Return CType(SqlHelper.ExecuteReader(ConnectionString, GetFullyQualifiedName("YourCompany_MyModule_GetCategories"), ModuleId), IDataReader)
      End Function
  3. App_Code\MyModule\DataProvider.vb:
    • Public MustOverride Function YourCompany_MyModule_GetCategories(ByVal ModuleId As Integer) As IDataReader
  4. App_Code\MyModule\MyModuleInfo.vb:
    • I've set and get the various variables : _CategoryID, _CategoryName, _CategoryDesc, _ModuleID, etc...
  5. App_Code\MyModule\MyModuleController.vb:
    • In here, I've created a function to return the list.
    • Public Shared Function MyModule_GetCategories(ByVal ModuleId As Integer) As List(Of MyModuleInfo)
       Return CBO.FillCollection(Of MyModuleInfo)(DataProvider.Instance().YourCompany_MyModule_GetCategories(ModuleId))
      End Function
  6. DesktopModules\MyModule\ViewMyModule.ascx:
    • I'd be displaying the dropdownlist here, to enable users to select the category.
    • <asp:dropdownList ID="list1" runat="server" />

Now, I'm stuck. How do I:

  • Initialise the list (to trigger the function, and return the list of categories)
  • Bind this list to the dropdownlist - "list1"

Thanks very much for your attention and help.

 

 

 

 

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Binding to Dropdownlist
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Easily Build DNN Solutions with XMod
XMod makes it easy to build news articles, house listings, custom feedback forms, product reviews and much more - without programming
www.DNNDev.com
Software Development and Integration with DNN
HNP Solutions focuses on the pragmatic use of technology and process to meet an organization's business objectives. HNP Solutions employs seasoned Enterprise and Solution Architects, Delivery Managers and QA & Business Leads. Our capabilities range from project assessments & recommendations, design & code reviews, to full program implementations. We also work with organizations in need of senior staff augmentation purposes in the areas of Enterprise and Solution architecture.
www.hnpsolutions.com
Alki Homes - Seattle, WA
Exemplary service for your Seattle Real Estate needs. It's what you deserve from your Realtor®!
www.alkihomes.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP