Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Constructing URL from master to detail viewConstructing URL from master to detail view
Previous
 
Next
New Post
2/9/2009 1:30 AM
 

I have a directory of teachers in a list view inside a view control in my module.  If the user clicks a teacher name, it takes them to a detail page for that teacher.  The detail page is a different tab, and it contains another view control to display the details for that teacher.

I'm trying to figure out how to construct the URL from the directory page to the detail page for a teacher.  To do this, the directory control will need to find the tabID where the detail control is.  How do I find the tabID of the details view control?

Thanks for your help!

 
New Post
2/9/2009 9:17 AM
Accepted Answer 

I would suggest including in the settings control for the master view a drop down list allowing the admin user to select the particular details view module. Code to populate the drop down list could be as follows:

Dim dmc As New Entities.Modules.DesktopModuleController
Dim dm As Entities.Modules.DesktopModuleInfo = dmc.GetDesktopModuleByModuleName("WESNet_EPrayer")
Dim mc As New Entities.Modules.ModuleController
Dim myMods As ArrayList = mc.GetModulesByDefinition(PortalId, dm.FriendlyName)
Dim mi As Entities.Modules.ModuleInfo
Dim tc As New Entities.Tabs.TabController
ddlMods.Items.Clear()
ddlMods.Items.Add(New ListItem("Select Details View Module", ""))
For Each mi In myMods
      Dim tabName As String = tc.GetTab(mi.TabID, PortalId, False).TabName
      ddlMods.Items.Add(New ListItem(String.format("Module named '{0}' on page '{1}'", _
                         mi.ModuleName, tabName), String.format("{0}-{1}", mi.TabID, mi.ModuleID)))
Next

Alternatively, if you are certain that one and only one details view module would ever exist in the portal, the drop down list could be eliminated and the above code modified to use the first (and only) element from the myMods ArrayList. In either case, the TabID-ModuleID string would then be stored in the master module's settings (using for example a settings key of "detailsModule")  to be later retrieved and used to build the URL (using one of the many forms of the NavigateUrl(...) method as follows (where teacherID is the details item ID):

Dim detailsModule As String = CType(ModuleSettings("detailsModule"), String)
Dim args As String() = detailsModule.Split("-"c)
Dim detailsURL As String = NavigateURL(Integer.Parse(args(0)), "", New String() {"mid=" & args(1), _
                                        "teacher=" & teacherID.ToString})

Please note that I have not included any error or security checks in the above code which has not been tested in an actual application.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/9/2009 2:58 PM
 

This was extremely helpful Bill, and probably saved me hours of fiddling.  Thanks a lot!

AldenG

 
New Post
2/10/2009 6:40 PM
 

Okay, everything else is working properly, and I'm turning to making this settings control.  This is going to sound like a really stupid question, but believe me, I've looked lots of places for the answer, including this forum.  How do I set the module definition to tell DNN my user control is a settings control?  All I found for this over at adefwebserver is:

You simply configure the User Control in in the module definition as a Settings control and a link is automatically created in the module's menu to navigate to it.

But I don't have "Settings" as a type in the module definition dropdown.  I've already made "view" and "edit" controls, and they work as expected.

Thanks for your help.  Again.

AldenG

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Constructing URL from master to detail viewConstructing URL from master to detail view


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out