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...Building ExtensionsBuilding ExtensionsModulesModulesError Displaying ASCX in ProjectError Displaying ASCX in Project
Previous
 
Next
New Post
5/22/2012 4:04 PM
 
Hello,

My Module is thorwing an error for an ASCX that I have added to the project.

This is the error:

Error: Cart is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---



I have added an ACX called ViewCart.ascx. Here is the module definition that I have included in my DNN file:


Cart
0


ViewCart
DesktopModules/eCommerce/ViewCart.ascx
False

View


0





For the moment my control is very minimal.

I have rebult the project and I have re-installed teh extension.

Any suggestions?

Thanks
 
New Post
5/23/2012 5:29 PM
 
does your ascx inherit from portalmodulebase (or IModuleControl) - if it still inherits from usercontrol dotnetnuke cannot recognise it.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
5/30/2012 10:34 AM
 
Thanks.

That was the problem. Allow me to expand on that in case somebody stumbles upon this.

When I added a new control (an ascx contrrol) it inherited from System.Web.UI.UserControl.

I replaced that with XXXXModuleBase. (XXXX is the name of the project.)

There happens to be 2 classes in the project:
XXXXModuleBase (aka XXXXModuleBase.cs)
XXXXSettingsBase (aka XXXXModuleBase.cs)

and XXXXModuleBase inherits PortalModuleBase.
 
New Post
6/1/2012 11:30 AM
 
Did this module work before adding the new ASCX?

If so, what happens if you remove that new ASCX file?

Also, check your namespace.
 
New Post
10/1/2012 4:50 AM
 

If u are using Your own  Controls (.ascx) other than the default (view, edit & settings .ascx), then you need to modify some code in your Web User Control.

Let I have added a module named as MyModule1, and inside MyModule1 i have added a WebUserControl named Demo

Then go to DesktopModules >> MyModule1 >> Demo.ascx

open it's code behind file i.e. Demo.ascx.cs and replace the Inherited class named "System.Web.UI.UserControl" with

"DotNetNuke.Entities.Modules.PortalModuleBase"

Before replacing it will look like below:-
public partial class DesktopModules_MyModule1_Demo : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}
After replacing it will look like below:-
public partial class DesktopModules_MyModule1_Demo : DotNetNuke.Entities.Modules.PortalModuleBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesError Displaying ASCX in ProjectError Displaying ASCX in Project


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