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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help in Creating my own control.Help in Creating my own control.
Previous
 
Next
New Post
12/14/2006 2:13 AM
 

I created my own .ascx control that sometimes I want to place inside another .ascx control because I want to be able to re-use the inner.ascx control in a variety of places inside the module.

In the pages that I want to place the inner.ascx page is simply have a <%@ Register TagPrefix="mhh" TagName="Inside" Src="inner.ascx" %>

and when I want the control I have

<mhh:Inside id="MyControl" runat="server"> </mhh:Inside>

In my code behind I have

Protected WithEvents MyControl as Inner

(I tried following a similar methodology to the way the DNN controls are created (ie User.ascx) to be reused in other controls.

I don't have any problems in DNN 3.x. My self made controls load up appropriately. However when I'm trying to load up these controls embedded inside another control I'm getting a DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(PortalModuleBase ctrlModule, Exception exc)

Can anyone shed some light on what I am doing wrong?

Thanks.

 

 
New Post
12/14/2006 8:42 AM
 

Do you mean you are loading that control inside another control?


Do you know the truth when you hear it?
Néstor Sánchez
The Dúnadan Raptor -->Follow Me on Twitter Now!
 
New Post
12/14/2006 10:02 AM
 
I do something similar to you but my control is compiled.  So, I just put my dll inside the dotnetnuke bin directory and have no problem making reference to it.

Here's my register code :
<%@ Register TagPrefix="DnnControls" Namespace="DnnControls" Assembly="DnnControls_v2" %>

Maybe you should consider compiling your control.
 
New Post
12/14/2006 10:15 AM
 

Hi hooligannes,

Yes I am placing one .ascx (page/control) inside another .ascx (page/control). Similar to the way the User.ascx and Address.ascx control is placed inside the registration.ascx control (at least in the older version of the application). This actually works in the older ASP 1.1/DNN3.x and my control came up just fine. The parent control showed the child control.

However when I try to install this module now in DNN4 (still compiled with VS2003/ASP1.1) I'm getting a null reference exception error. I must be missing something real obvious, just wish I knew what it was.

Thanks.

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help in Creating my own control.Help in Creating my own control.


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