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...Getting StartedGetting StartedModule that contains only view pageModule that contains only view page
Previous
 
Next
New Post
9/4/2012 6:00 PM
 

Hello,

I'm developing custom modules for my project in dnn. I've been using Cris Hammond module template for C# sucessfully so far. Great job an thank You ! 

But going deeper into my project, I've come into the point, that I need more then one view page in my module. It cannot be multiview from asp, since I want to display content base on url but cannot let user to interfere (by get request).

So I see two ways of solving my problem and I want to ask You what is possible and what is more reasonable :

1) add additional ascx to my module. But how can I accomplish this and what would be the url for the second page ?

2) build second module and put it on another page. But can I make my custom module thinner ? I mean to get rid of setting and edit page. To get rid of licence.txt or sql provider (since I'm not using it) Or maybe those files are not gonna interfere with dnn quality ? ( for me more files that are installed == slower performance ) ?

Thank You for Your help ;)

 
New Post
9/4/2012 7:33 PM
 

A module may certainly have more than one view control. Add an additional .ascx user control (also inheriting from PortalModuleBase) and when registering this new control give it a unique ControlKey. Note that there most be one and only one view control (the default view) which will have a blank ControlKey.

You may then redirect to the second view control using one of the overloads of the DotNetNuke.Common.Globals.NavigateURL() method passing in parameters for the ModuleId and ControlKey as well as any others such as your entity ID needed by the second view. See the following Wiki entry for details: http://www.dotnetnuke.com/Resources/W....

What I don't like about this approach is that anytime the ControlKey is passed in the URL (e.g. ?ctl=details), the DNN framework switches to the "edit" skin and isolates the targeted module by itself on the page.

My preference would be to use a single view control with multiple views - multiple divs, panels, or multiview control hiding the unused views and displaying the target view based on url parameters. Although I'm not fully comfortable with it yet (having spent most of my programming days writing backend/server-side code), the trend today is toward the single view control with most of the work being done client-side using jQuery, Knockout, web service for data access, etc. Take a look at how the new social features - journal, groups, member directory are coded in the DNN 6.2.x source.

A different approach to have multiple view controls on the same page simultaneously is by creating a second .ascx that is registered with a blank ControlKey but which is registered using a different ModuleDefinition than the first. One of the few formerly "core" modules which takes that approach is the Blog module whose source is available in the Forge/CodePlex. Take a look at it's manifest file to see how this may be done.

My least favored approach in this case would be to create a second module (view control with blank ControlKey) and place it on a different page. You can certainly create the second module with only a view control (no edit or settings control) and share common entity classes, controller, and SQL stored proceedures with the main module. But . . . the first module will have to be aware of the ModuleId (which will be different) and TabID or page name of the second module to properly redirect. This should not be hard-coded but automatically or manually configured in the first module's settings. The other problem is packaging the two modules for installation. Although you can (manually) create a single zip archive having multiple modules/packages - each module will show up in the Host-->Extensions Installed Modules view as a distinct module/package. The Store module available in the Forge/CodePlex is one that takes this approach. Likewise with the core Search and Search Results module - although they are not installed though the usual zip archive packaging.

I hope this helps in your development!


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
9/5/2012 4:17 AM
 
Thank You for this long and useful replay.
My task is to serve bidding process. So there are two views - one where user is deciding whether to bid or not, and second with bidding summary.
So everything was good at the beginning. By GET I was passing values (like auction id) and creating the view using BidModel class containing text. After hitting the button some method was changing multiview for the second one.
But I had problems:
- in summary view if someone would hit F5 - than asp is repeating the last action - so button that was clicked, and user is bidding for the second time - unacceptable
- so I was trying to save somewhere the information that bidding is already done - but where ? another parameter in GET seems no good, than I tried Session variable or static variable for view information but:
- this is generating another kind of "error" - if someone is trying to bid in a few tab in browser - date is getting mixed up

So right now I'm thinking about:
- one page which is for the first view, it's getting parameters from GET and if refreshed - again from GET - so no problem for more than one tab
- after hitting the button, method is triggered, result will be put into session, redirect to different page but the same module inside, using settings I could force particular view in the multiview. Here when someone would hit F5 than the result would be the last bidding summary. Or I could pass GET value and calculate the result from the database.

Do You thing this make sense ? I thing putting the same module twice using settings will give me more than one page and everything controlled by GET.
 
New Post
10/4/2012 6:25 AM
 

"Note that there most be one and only one view control (the default view) which will have a blank ControlKey."

 Ok, True. But WHY?? And where you may find such information in available documents. It is not intuitive at all.


Regards rypki
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedModule that contains only view pageModule that contains only view page


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