Hi,
I created a Module using the starter kit and installed it and added it to a page successfully in my DNN site.
In that module i want to call User Controls that calls other User Controls consecutively.
I'm working with a team so using MultiViews is not an option.
The problem is, when i add a Reference to my User Control (for testing purposes that UC consists only in a label), the module stops working.
=====================================
Source Code:
ViewFormacao.ascx:
<%@ Control language="C#" Inherits="YourCompany.Modules.Formacao.ViewFormacao" CodeFile="ViewFormacao.ascx.cs" AutoEventWireup="true"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
ViewFormacao.ascx.cs:
(...)
protected void Page_Load(System.Object sender, System.EventArgs e)
{
}
(...)
//Basically, I deleted everything in Page_Load and the datalist event created by the starter kit.
=====================================
That code works fine but when i add a:
<%@ Reference Control="~/Teste.ascx" %>
to ViewFormacao.ascx the module stops working.
=====================================
More Source Code:
Teste.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Teste.ascx.cs" Inherits="Teste" %>
<asp:Label ID="Label1" runat="server" Text="User Control"></asp:Label><br />
Teste.ascx.cs
(...)
//using stuff including the DotNetNuke, DotNetNuke.Common, etc.
namespace YourCompany.Modules.Formacao
{
public partial class Teste : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
=====================================
The error i get is:
Module Load Warning
One or more of the modules on this page did not load. This may be temporary. Please refresh the page (click F5 in most browsers). If the problem persists, please let the Site Administrator know.
I also tried the steps in NavigateURL: How to make A DotNetNuke® link tutotial by Michael Washington but the outcome was odd.
It displays the same above message but loads the User Control right below it. But the User Control is empty.
So, the question is...can we use References in DNN just like we use in normal asp.net?
Thank you for your time,
Tiago Costa