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...DNN Platform (o...DNN Platform (o...Nested User Controls donNested User Controls don't get a proper DNN context?
Previous
 
Next
New Post
10/1/2009 6:29 PM
 

UPDATED:  For what it's worth, I've upgraded my test system to 5.1.4.  I have also corrected my observations.

I have created several user controls that I want to use within my module.  However, I seem to be having a problem and I'm sure it's something I'm doing wrong / don't understand.

When the controls are placed in my module, it seems  that the context does not seem to be completely populated.  Only some of the normal properties are initialized.  For example ModuleId = -1. But, UserId and PortalId are correct.  However, if I use examine the values from the module itself, the values are correct.

All of my user controls inherit from PortalModuleBase.

So module.ascx has somethign like this in it:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="module.ascx.cs" Inherits="mycompany.Modules.mynamespace.mymodule" %>
<%@ Register TagPrefix="mystuff" TagName="controlA" Src="controlA.ascx" %>
A= <mystuff:controlA ID="myControlA" runat="server" />
<br>
B= <mystuff:controlA ID="myControlB" runat="server" />
<br>
ModuleId=<%= ModuleId %> UserId=<%= UserId %>

controlA.ascx lookes like this:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="controlA.ascx.cs" Inherits="mycompany.Modules.mynamespace.controlA" %>
<%@ Register TagPrefix="mystuff" TagName="controlB" Src="controlB.ascx" %>
<mystuff:controlA ID="myControlB" runat="server" />

controlB.ascx looks like this:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="controlB.ascx.cs" Inherits="mycompany.Modules.mynamespace.controlB" %>
ModuleId=<%= ModuleId %> UserId=<%= UserId %>

The output looks something like this:

A= ModuleId=-1 UserId=45
B= ModuleId=-1 UserId=45
ModuleId=1234 UserId=45

This is really confusing me.  Is there something special about ModuleId?  Any insight would be helpful.

Thanks!

 
New Post
10/3/2009 9:49 PM
 
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Nested User Controls donNested User Controls don't get a proper DNN context?


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