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  |  

Affordable ASP.NET Hosting Service
  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Moduleid in usercontrols
Previous Previous
 
Next Next
New Post 7/22/2008 9:20 AM
Resolved
User is offline Dylan Barber
651 posts
7th Ranked


Moduleid in usercontrols 

we have built a few controls (not modules) like a better datepicker etc for our use in DNN now we find olurselves needing the module id in a control - now i looked in the controls in the library/controls and see that the user and urlcontrol get this from the v13wstat3 however when i try to do that i get a -1 all the time

 

How should i get the module id in a control for dnn? (i inherit from famework.usercontrolbase i thin this is right but could be part of my problems if its wrong)

 
New Post 7/22/2008 9:50 AM
User is offline Arash
17 posts
10th Ranked


Re: Moduleid in usercontrols 

If you're using your controls in a module that you built yourself, you can use query strings to pass ModuleId.

Arash

 
New Post 7/22/2008 11:39 AM
Accepted Answer 
User is offline Dylan Barber
651 posts
7th Ranked


Re: Moduleid in usercontrols 
Modified By Dylan Barber  on 7/22/2008 1:41:31 PM)

Okay I will answer my own question with a solution that seems to work all the time in DNN

 

 

 Dim myPortalModuleBase As DotNetNuke.Entities.Modules.PortalModuleBase = CType(Me.Parent, DotNetNuke.Entities.Modules.PortalModuleBase)

 

Then i can user myPortalModuleBase.ModuleId (or whatever else) to get data from the host control(module) - be aware this makes your controls very specific to DNN - they will break in non DNN sites.

 

Anybody have a reason this is a bad practice?

 
New Post 7/22/2008 1:40 PM
User is offline Dylan Barber
651 posts
7th Ranked


Re: Moduleid in usercontrols 
Modified By Dylan Barber  on 7/22/2008 3:41:55 PM)

even better in case you bury controls a few levels deep

 

 Private Function ParentDNNModulePage(ByVal myControl As Control) As DotNetNuke.Entities.Modules.PortalModuleBase
            Dim MyParentID As New DotNetNuke.Entities.Modules.PortalModuleBase
            Try
                MyParentID = CType(myControl, DotNetNuke.Entities.Modules.PortalModuleBase)
            Catch ex As Exception
                MyParentID = ParentDNNModulePage(myControl.Parent)
            End Try
            Return MyParentID
        End Function

then simply create an object to handle the return


 Dim ModuleInfo As DotNetNuke.Entities.Modules.PortalModuleBase = ParentDNNModulePage(Me)

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Moduleid in usercontrols
 


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.

 


UK DotNetNuke CMS installation, hosting & support
UK based installation, branding, customising, integration, hosting, training, support and maintenance services for DotNetNuke
www.deburca.co.uk
Need Help with your DotNetNuke website?
Jango Studios offers exclusive DotNetNuke Skin Design, Module Development, Web Marketing and Web Hosting.
www.jangostudios.net
Where Every Home is an Investment
Where Every Home is an Investment
www.nestbrokers.com

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