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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...What DNN program gets called first when you click on a Module/Menu Tab ?What DNN program gets called first when you click on a Module/Menu Tab ?
Previous
 
Next
New Post
9/23/2009 9:48 PM
 

   I have developed an application that has several modules. I have installed these modules as menu items in my DNN site.
   I am trying to find a place to put some initialization code so that when any of my applications modules are called they have certain initial instructions.
   One thing I thought of was to create one ascx and use it like a Traffic Cop (TC).  I would go into the module definitions for all of my applications modules and make this TC the control source.  When a module tab is clicked, this TC would be called, initialize some session variables, then from the tabid I could call the appropriate ascx program to run.    

  Or is there a "right" or Better way to do this ?

 thanks for your time

 

 
New Post
9/24/2009 4:08 AM
 

My initial reaction is that you should write that code once - possibly in a static/shared method, and call it from an event (probably the Page_Load) all of your modules.

Is there some reason why that will not work for you?


Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
9/28/2009 8:18 PM
 

David : to answer your first question, DNN is an ASP.NET application, so it follows all the normal rules of an ASP.NET page lifecycle.  It's always good to review this if you're building a module, even if you've studied it in the past. 

Without knowing your exact requirements, you may find it difficult to achieve what you like with an ascx file.  The order that these get executed in DNN depends on the order they are placed onto the page, which is something you don't have control over.  You can, of course, create a usercontrol which exists on each module control in your module, and you can run initialisation code within that.  It's not clear from your post whether you mean first run (ie, after installed) or initialization on each run (ie, every time page is called).

You might also look into a HttpModule, which will be called for each request to the asp.net application (ie, for each page in DNN).   This might be too much for your needs, or might suit perfectly.  Bear in mind you won't have any page context within the HttpModule code, but if your initialisation needs are simple, this might work.  You woudl also have to have a built-in filter for your http module so that it only runs on requests that it needs to (ie, dnn pages).  It's easy to forget that asp.net requests are for more than just .aspx extensions : They will run on .axd, .ashx requests as well.

 
New Post
10/12/2009 7:47 PM
 

   Bruce 
       The requirnment was to access legacy web pages from an IFrame rather than rewrite them into modules because they where going to be rewritten with Telerik anyway. But since IFrame launches its pages into another thread I could not grab some portal info. So, I was wondering If could get the portal info first by writing a control that could be called BEFORE the IFrame launches the page.  (Same issue with HTTPModule I am thinking ? )
       During the last few days I have debugged DNN vb and I found some spots in IFrame.vb and IFrameEdit.vb. 
    Thanks for your suggestions. -  

                    

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...What DNN program gets called first when you click on a Module/Menu Tab ?What DNN program gets called first when you click on a Module/Menu Tab ?


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