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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Error Handling: ProcessModuleLoadExceptionError Handling: ProcessModuleLoadException
Previous
 
Next
New Post
3/9/2006 9:44 AM
 

Hi,

(Hope this is an appropriate place to post such a question - if not I apologise)

I've developed a module comprising of a couple of controls (e.g. one of type View, another of type Edit etc.). The view control comprises of a menu system and a placeholder. At runtime depending on which menu item is selected I dynamically load a user control (using the LoadControl method) into the placeholder - essentially providing me with mutiple interfaces. Anway I wish to use DotNetNuke's exception class to handle errors in the dynamically loaded parts of my module, however if I call ProcessModuleLoadException(me, exc) as I've seen it used, from within the click event of a button for example, I always get the following error displayed:

A critical error has occurred.
Object reference not set to an instance of an object.

This occurs no matter what the actual error is (e.g. either a simple division by zero error will produce the same result as a data access error). It seems that something in the error handling chain is falling over - or I'm passing in the wrong arguments. Through trial and error I've found that if I use ProcessModuleLoadException(me.Parent, exc)  instead - it seems to work, i.e. I'll get the actual error presented on the page or if I use ProcessModuleLoadException("Custom message" me.Parent, exc, True) I can provide a custom message. Please could someone explain why I have to do this (i.e. use me.Parent instead of simply me)? In the ProcessModuleLoadException declaration the first argument (i.e. the me part) is declared as Entities.Modules.PortalModuleBase. My module and the user controls I load dynamically all inherit from this class.

Thanks,

Norm

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Error Handling: ProcessModuleLoadExceptionError Handling: ProcessModuleLoadException


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