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!