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 Startedinherit PortalModuleBase not correct?inherit PortalModuleBase not correct?
Previous
 
Next
New Post
2/4/2011 1:44 AM
 
Hi, I'm trying to build my first DNN module. I copied a sample code which has the following

using System;
using DotNetNuke.Entities.Modules;

namespace HelloWorld3
{
public partial class View : PortalModuleBase

However, when I complied, I was given the following error

Error 2 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). C:\inetpub\wwwroot\dnndev\DesktopModules\HelloWorld3\View.ascx.cs 6 33 http://localhost/dnndev/


Can someone tell me where I did wrong?

Thanks!
 
New Post
2/4/2011 8:50 AM
 
Please post the @Control directive in your View.ascx.

Also, on the Application tab of the projects property pages in Visual Studio, is there any text entered in the Root Namespace text box?

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
2/4/2011 1:11 PM
 
Here it is. Where can I find the Root Namespace text box? I'm using Visual Web Developer 2010 Express.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="View.ascx.cs" Inherits="DesktopModules_HelloWorld3_View" %>
 
New Post
2/4/2011 4:26 PM
 
I've never used Visual Web Developer 2010 Express so don't know if VWD lets you specify a root namespace.

As I suspected, the problem is in the @ Control directive in View.ascx:

1. In your CodeFile, View.ascx.cs, the fully qualified partial class name is "HelloWorld3.View"
2. However, in the .ascx control, the Inherits attribute is "DesktopModules_HelloWorld3_View".
3. Assuming that there is no root namespace box specifying a root namespace of "DesktopModules", the Inherits attribute in the @Control directive should be changed to Inherits="HelloWorld3.View" Note the use of a dot instead of an underscore to separate the namespace from the class name.

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
2/5/2011 12:28 AM
 
this was exactly the issue. thanks so much for pointing it out!
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting Startedinherit PortalModuleBase not correct?inherit PortalModuleBase not correct?


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