We are trying to create a DNN module that includes a rich text editor so our end users can enter/edit html content.
However, when we add code to reference the “text” property of our texteditor control (or any property for that matter) we get the following compile error:
“'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?)”
Below is code to a sample module we created to reproduce this error.
Code from our .ascx page (ucTestEditor_Test.axcx)
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucTextEditor_Test.ascx.cs" Inherits="rc.TextEditor_Test.ucTextEditor_Test" %>
<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx" %>
<%@ Register TagPrefix="dnn" Assembly="DotNetNuke.Web" Namespace="DotNetNuke.Web.UI.WebControls" %>
<div style="padding: 1px 1px 1px 1px;">
<dnn:TextEditor ID="teRSummary" runat="server" Width="100%" Height="300px" cssclass="Normal" Enable="true"/><br/>
</div>
<div class="dnnFormItem" style="padding: 5px 5px 5px 5px;">
<asp:Label ID="Label1" runat="server" Text=" "></asp:Label>
</div>
<div class="dnnFormItem" style="padding: 3px 3px 3px 3px; font-size: 12pt; font-family: Verdana, sans-serif; font-weight:normal; color:#002d62; text-decoration:double;">
<asp:Button ID="Submit" runat="server" Text="Submit" OnClick="Submit_Click" />
</div>
Code from our .cs page (ucTestEditor_Test.axcx.cs)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;
namespace rc.TextEditor_Test
{
public partial class ucTextEditor_Test : PortalModuleBase
{
public string CssClass { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Label1.Text = "";
}
}
protected void Submit_Click(object sender, EventArgs e)
{
Label1.Text = "teRSummary :" + teRSummary.Text;
}
}
}
All references within the project appear to be correct.
Any info on a solution to this problem would be appreciated.
Thanks
Lee