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 StartedMultiple views for one moduleMultiple views for one module
Previous
 
Next
New Post
2/1/2012 10:18 AM
 
Hi ,

I'm an absolute beginner in dotnetnuke's module development so I hope I will not bother you with my questions...

So far I've followed the videos on this wiki page: Module Development, and I have used this template to build a basic  module.

Now I need to go one step beyond, I'm building a module that should handles multiple kind of entities, let's say Accounts, Sales, and Reports. So I'm thinking multiple views...

I don't know the best way to handle multiple views in one module but I have seen here and there how to load dynamically the control that I need, I've tried and it works.

So now how do I know which instance of my module should show which view ? Do I need to store a table with a ModuleID and the view associated ? Also I have read that their could be viewstate problems with this method, is it problematic ?

 Thanks

 
New Post
2/1/2012 7:36 PM
 

There are a number of different options for complex module systems.

Each come with their own set of work flow issues.

For big systems - I prefer creating separate modules for each individual task.  That way you place the accounts module on a page and its automatically the accounts module - no extra layers of stuffing around with dynamics and redirection - also its much easier to take advantage of dnn's inbuilt permissions and roles systems if you dont need to code for it explicitly inside a single mega module - you can set access permissions at the page level at let dnn handle things.

Dynamic loading has its place - but it also comes with a whole very messy layer of additional coding and state handling issues which often seem to add more work and effort than the benefits of using it bring.  Not to mention debugging nightmares.
A simple example of this is the need to manually handle the recreation of the dynamic elements on every postback.

A site we have just finished has something like 35 custom modules in its system - doing all that with one mega module would have been not a fun job.

DNN already has all this cool code into it to handle dynamic loading at the page level - the way I see it - unless you absolutely have a situation where you need to dynamically or otherwise load custom controls yourself - take advantage of what dnn has built it.  Let it load modules onto pages etc.

As to your other question about where to store information - dnn has a very good built in modulesettings system that lets your store pretty much any sort of information about a module inside the generic dnn database without the need for creating your own table.
For simple information like a module mode or state this is the best place to store that sort of thing.  Obviously if you are building an account system or some such you create tables for that sort of data - but for information about a module - modulesettings or tabmodulesettings is the best option.  DNN also includes the ability to store personalization settings as well - basically per user information unique to a module instance.

If you really do want to go down the multiple views in one module approach - one other option instead of dynamic loading is to use the asp.net panel or multiview components.  That let you switch the information you are displaying at any time.

Just my 2 cents

Westa


 
New Post
2/1/2012 7:36 PM
 
if you dynamically load controls you will have to handle the viewstate issue (see http://chiragrdarji.wordpress.com/2009/05/20/maintain-viewstate-for-dynamic-controls-across-the-postback/ for a few examples of how to do so). Alternatively you can create seperate modulecontrols and load these (e.g. via NavigateURL) for the individual functions.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
2/2/2012 5:01 AM
 

 

Wes Tatters> Thanks for the input, I really appreciate it.

Actually after what you said I don't know anymore if I need to do one big module or one for each functionality. It is true that I need to handle permissions and I definitely want to use dnn's built in roles. I thought that one big module would facilitate deployment but if it makes navigation harder....

But how do you handle related data ? for example the sales are going to be linked to clients, if sales and clients are in 2 modules it's going to be problematic. Do you use a library as a datalayer that both modules reference?

And how do you navigate between modules, if I'm in the sales module and I need to add a new client, do I need to create a link to the page with the client module ? Hardcode a link in a module to a page created dynamically seems wrong to me...

Most of my entities are going to be linked one way or another to the other, and they will need to interact between themselves. But they also needs their own set of permissions, and I don't understand yet how all of this will work.

cathal connolly> Thanks for the input also, but as you can see above, I'm not really sure of the way to go and after reading this article about navigation (mostly the end: "Why recreate extensive navigation when the framework already provides it?") I tend to agree with Wes' choice, but it brings many questions to the surface.

 
New Post
2/2/2012 8:56 AM
 
hello, you don't hardcode the paths, instead generate them e.g. add an asp.net hyperlink and set it's navigateurl property to the value of the control and pass any additional parameters e.g. NavigateURL(portalSettings."yourcustom control", "", string.Format("clientId={0}", clientId));

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedMultiple views for one moduleMultiple views for one module


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