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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Help- adding c# ascx as moduleHelp- adding c# ascx as module
Previous
 
Next
New Post
7/31/2011 5:11 AM
 

I am trying to include a c# ascx file as module but it doesnt shows up as a resource in DNN.
I copied my folder(containing just the dll) into DesktopModules folder. I then went
Host->Extenstions->Manage->Create New Module
'Create new module from' ->Control
'Module folder' drop down does show the folder I created.When I select it, I was expecting
that 'Resource' drop down to populate my user control name but it doesnt show up anything.
Am I missing someone?
My ascx control code is as below -

using System;
using DotNetNuke.Entities.Modules;
namespace MyWebControl
{
    public partial class MyControl : PortalModuleBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblName.Text = "Hello world";
        }
    }
}

Thanks in advance..

 
New Post
7/31/2011 12:11 PM
 
Nick if you haven't already you should read up on a few of the module programming guides from DNN and the many blogs on the subject.

The DLL should really be in the /bin folder of DNN. Your ASCX and ASCX.CS files would be located in the DesktopModules/YourModule folder along with an realted CSS, JS, resource files, etc.

Personally, I'm a really big fan of Chris' Module development template: http://christoctemplate.codeplex.com/

as it sets up a basic module template in Visual Studio and also handles the packaging of an installable module when you build for a release...which mean you an simply use the extensions install wizard to install your module instead of manually using the module definitions.



Steven Webster
Manager, Community Platform
F5 Networks, DevCentral
 
New Post
8/1/2011 9:04 AM
 
Thanks, I'll try Chris's module.

Btw, got the dll and .ascx at the right place and was able to add the control as module. But, when I add it to a page it give a 'Module load exception : Object reference not set to an instance of an object. The ascx is a simple hello world example.

Any ideas?
 
New Post
8/1/2011 10:30 PM
 
sorry..my bad..control wasnt inherited from PortalModuleBase
Works fine now :)
Thanks
 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...Help- adding c# ascx as moduleHelp- adding c# ascx as 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