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...Building ExtensionsBuilding ExtensionsModulesModulesNavigateURL - Module with Multiple ViewsNavigateURL - Module with Multiple Views
Previous
 
Next
New Post
6/30/2014 8:08 PM
 

Hi,

I am trying to build a module which will have multiple views, but I am having trouble navigating from one view to the other. I am using the standard View.ascx as well as SecondView.ascx. I have both controls registered, with SecondView having a Control Key of simply "SV". I have a link in View that when clicked I would like it to navigate to SecondView and keep all other modules on the page.

Now, I can get simple navigation working using:

NavigateURL(PortalSettings.ActiveTab.TabID, "SV", "mid=" + ModuleId.ToString )

However, it loads with the host/edit skin and not the same skin for the View page, and it removes all other modules from the page. Also, I have tried the following which return the same skin, but do not load the SecondView at all, just a blank page:

NavigateURL("SV")

NavigateURL(PortalSettings.ActiveTab.TabID, "SV")

 So, my question(s) are:

  1. Is there a way to Navigate to the SecondView while retaining the same skin and all other modules on the page?
  2. Is there a way when I add the control to a page that I can specify which view I want to show by default?

Thanks.

 Also: I have checked Michael Washington's site and looked at his page on Module Navigation Options.

 
New Post
7/1/2014 12:44 AM
 

What you're seeing is normal DNN behavior. Whenever "ctl=controlkey" appears in the querystring to force the loading of a module control other than the module's default (no controlkey) view control, there will be a switch to the edit skin and an isolation of the target module on the page. There are several ways to get around this and still have multiple view controls. Here are several variations of my favorite approach:

Register one and only one view control which acts as a dispatcher to several "sub"-view controls. Display of the sub-view can be based on a querystring parameter (other than ctl=), a tabmodule setting where multiple copy modules each having a different sub-view are placed on multiple pages, selection by the user from a navigation menu/buttons/drop-down, etc. within the dispatch control, etc.

The dispatcher control will display the selected sub-view by either showing/hiding panels (divs or an ASP.Net panel control) or by using LoadControl to dynamically load the appropriate sub-view. In the latter case you will find it easiest to have the sub-views inherit from PortalModuleBase and copying the ModuleCofiguration from the dispatcher control to the sub-view control after loading it.

With a trend toward client-side technologies, you might also consider using a form of templating (for example using KnockoutJS) to display user selectable views of data obtained via a web service all within the same module control.

 


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
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesNavigateURL - Module with Multiple ViewsNavigateURL - Module with Multiple Views


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