0

This question has probably been the most covered question in all of DotNetNuke's lifetime but I'm going to ask it here in StackOverflow because I need an answer, a really good one that doesn't make me look the other way. Thanks in advance to all DNN experts.

I've researched many ways of making this work for me and i've seen Michael Washington's solutions (Panels, MultiViews, ...) and Will's (Strohl) blog post on DotNetNuke's personalization engine through setting SkinSrc which is useful, as well as reading through Default.aspx's code which has given me more insight, however, i'm still faced with the problem that calling EditUrl()/NavigateUrl() brings me to a page with a single module in admin skin or a page with nothing respectively.

The specific version is DotNetNuke 6.0.1 (DNN). This Module has 4 other views in addition to the main view which I desire to navigate through sequentially. e.g. Begin Checkout -> Collection of Delivery Details -> Confim Order

Have you found a solution?

I want to achieve 1) Module loads with other modules around. No module isolation 2) Views in a module that don't Preload e.g. Page_Load in each view gets called when the Module loads up

Help!

karbonphyber
  • 156
  • 10

1 Answers1

4

Assuming you are asking this as the module developer, the solution is to not use DNN's mechanism for specifying a control. So, you can't use EditUrl or specify the ControlKey in the NavigateURL call (which both generate "ctl=mycontrol" in the URL). Instead you need to have your module display your various controls based on the Query String parameters. So, you'll generally have a control in your module who's primary purpose is to dynamically load other controls based on the query string. So, for instance:

  1. You will start with your control that lists items. You'll have a "Buy Now" button for each item. The hyperlink for each item can be generated by calling

NavigateURL(TabID, "", "View=BeginCheckout", "itemid=" & id, "mid=" & mid)

2.) On the page load of the handler control, it looks to see if anything is specified for the "View" Querystring parameter. If not it displays the listing control, if so, it displays the corresponding control.

    Dim controlPath As String
Dim path as String = "~/DesktopModules/MyModule/Controls"
Select Case Request("View")
    Case "BeginCheckout"
        ControlPath = path + "BeginCheckout.ascx"
    Case "DeliveryDetails"
        ControlPath = path + "DeliveryDetails.ascx"
    Case "ConfirmOrder"
        ControlPath = path + "ConfirmOrder.ascx"
    Case Else
        ControlPath = path + "ItemList.aspx"
End Select

If System.IO.File.Exists(Request.MapPath(controlPath)) Then
    placeholder.LoadControl(controlPath)
Else
        Throw New Exception("Unable to load selected template. Please go into module settings and select a list and details template.")
End If

Most of the advanced modules for DNN do something along these lines so there's plenty of sample code out there. I would guess some of the core modules do something similar. I adapted the code above from Efficon's Articles module for DotNetNuke.

EfficionDave
  • 2,736
  • 3
  • 31
  • 38
  • Thanks for that Dave!I figured there wasn't any nicer way to avoid having to do that. – karbonphyber Dec 06 '11 at 04:10
  • What I eventually decided to go with was 1) re-purposing the Control Views that were pages in the Check out Process, changed each Page_Load event to a Public method that would be executed when the View was required. This would prevent each page_load running when I didn't want them to. Each page had guarding implemented and so, Page-Load running when the first page was loaded, was not desired. 2) going MultiView and Registering the controls beforehand in the headers. Placing controls on the master page. 3) Created a PageChange event which would change pages when fired from the Control Views. – karbonphyber Dec 06 '11 at 04:17