1
votes

I'm new DNN. I have problem with navigation in DNN. I have a module with a display page and two views:

  1. List of all Items
  2. List of approving Items

I create a module with two Module Definitions for those views control. The first definition include two controls:

  1. View control
  2. Display control

The second definition include one control: 1. View control

My problem is the navigation Url from view1 to display page is working OK but navigation from view2 is bring me to blank page. This is navigation in two views:

View1: http://dnndev.me/en-us/vnp/services/service/ctl/Display/mid/426/id/82

View2: http://dnndev.me/en-us/vnp/services/service/ctl/Display/mid/427/id/82

Anyone help me. Thanks alot.

1

1 Answers

1
votes

I would recommend you only create one Module definition, for a base "View" control, in that View control, put a place holder, and when loading the page have that view control determine what ASCX file to load in the place holder.

You can see examples of this in y DNN Simple Article module http://dnnsimplearticle.codeplex.com/

Basically ASCX side

<asp:PlaceHolder ID="phViewControl" runat="server" />

Code Behind

try
{
    var controlToLoad = "Controls/ArticleList.ascx";
    if (ArticleId > 0)
    {
        controlToLoad = "Controls/ArticleView.ascx";
    }

    var mbl = (dnnsimplearticleModuleBase)LoadControl(controlToLoad);
    mbl.ModuleConfiguration = ModuleConfiguration;
    mbl.ID = System.IO.Path.GetFileNameWithoutExtension(controlToLoad);
    phViewControl.Controls.Add(mbl);
}
catch (Exception exc) //Module failed to load
{
    Exceptions.ProcessModuleLoadException(this, exc);
}

The key there is the "ArticleId" property in the base class, that reads from a query string parameter, if the parameter exists the Detail view is loaded.

That's how I take the approach of loading a "List" and "Details" view. You can definitely make this more complex as well.