I went through Michael Washington's tutorial on DNN 4 module development, and successfully created a quiz module that did what I needed.
Now, I want to convert my module to the WAP project-style, and the first thing I did was get the starter kit and verify that the basic module that it gives you is working correctly. Indeed everything works fine.
I then set about changing the namespaces (everything is in the "YourCompany" namespace by default). I started with the UserControls--the View control, Settings control, and Edit control. View and Settings control went smoothly, and after changing the namespaces the project still built fine and was running in my dev DNN environment.
But after changing the namespace declarations on the Edit control (EditTestWapModule.ascx and the .cs files), I started getting build errors like the following:
error CS1061: 'System.Web.UI.UserControl' does not contain a definition for 'Text'
and no extension method 'Text' accepting a first argument of type
'System.Web.UI.UserControl' could be found (are you missing a using directive
or an assembly reference?)
It's complaining about this control:
<dnn:TextEditor id="txtContent" runat="server" height="200" width="500" />
I noted that in the .designer.cs file, it's declared just as a UserControl--that's not right, is it?
/// <summary>
/// txtContent control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UserControl txtContent;
I also noted that in the .ascx file, there are squiggly lines under the the Src attribute for each of the following:
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/labelcontrol.ascx" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
If I hover over them, ithas errors like "File '~/controls/labelcontrol.ascx' was not found."
There is also a squiggly line under "TextEditor" in the "dnn:TextEditor" tag, and hovering over that reveals that "Element 'TextEditor' is not a known element."
So what happens that it appears to have forgotten about all the DNN controls? I tried changing the namespaces back to "YourCompany" everywhere I changed them, but that didn't do anything. It seems like when I changed the "Inherits" attribute in EditTestWapModule.ascx, it regenerated the .designer.cs file, and ever since then it has not been able to properly resolve the DNN controls.