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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0New Module VS 2nd View Control in same moduleNew Module VS 2nd View Control in same module
Previous
 
Next
New Post
11/15/2006 3:21 PM
 

I need to display a page that uses most of the same data (same info class, same controller class, same sqlDataProvider) as I use in an existing module. 

I tried to create a second ascx file in the same module.  I use a button on the first ascx file to bring up the second ascx file. Everything works great EXCEPT the second ascx file displays the wrong skin (I think it's either a default skin or an admin skin).

Question 1: Should I create a new module, or should I create a second ascx file in the same module?

Question 2:  IFF a second ascx file is the right answer, why does it display a different skin than the default View ascx file?  Is there some registration I need to do?

Thank you for your help.

Mark

 

 
New Post
11/15/2006 6:07 PM
 

The automatic switch to the admin skin and exclusion of other modules from the page that you are experiencing is normal DNN framework behavior for any controls other than the default (with blank key) view control.

Although you could create a second module which would share the same info and controller classes, etc., you may have a problem if you have followed the usual practice of keying your data on the ModuleId. You'll also have a problem with sharing Module Settings which are keyed to either ModuleId or TabModuleId.

To avoid the automatic switch to the admin skin and to allow the best reuse of code, I prefer to use the concept of sub-views in which the main or dispatch module uses LoadControl to dynamically load other .ascx files to display or allow the user to interact with the same data in different ways.  Another possibility is to use panels or multi-view/view controls (ASP.NET 2 only) or tables or table rows with id and runat="server" attributes set so that they can be selectively displayed or hidden. Along with this technique, you may find it necessary to define more global module settings that are keyed to PortalId or ModuleDefId.  I started using the combination of techniques often enough that I built a framework called ModuleViews that extends the pattern of the Module/ModuleControl (keyed by control key) to one of Module/ModuleControl/ModuleView (keyed by view key).  The source code of this framework (for DNN 4.x) is available free on the downloads page of my website (http://www.wesnetdesigns.com) to registered users. As the code is not documented or complete (problems in the IUpgradable interface implementation), I do not consider it a solution for the inexperienced developer.

Further discussion of this same problem may be found in this recent thread: http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/-1/threadid/83465/scope/posts/Default.aspx


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
11/15/2006 6:27 PM
 


Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0New Module VS 2nd View Control in same moduleNew Module VS 2nd View Control in same 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