简体   繁体   中英

How to use RadEditor in dnn module?

I want to use RadEditor in my dnn module. We usually add reference of control to project then add register tag to page and at the final we can write code and use this control.Now Which reference should be added and How to fill radeditor with a string and read a string that exist into editor? Please advice.

The DNN Texteditor is the control that you want. In most DNN 6 and 7 editions, the default editor is a wrapper around Telerik's RadEditor.

<%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/texteditor.ascx" %>

...

<dnn:TextEditor ID="txtHtmlEditor" runat="server" Width="100%" Height="250px" ChooseMode="true" HtmlEncode="false"></dnn:TextEditor>

In your .ascx.cs code, you have the following reference:

protected DotNetNuke.UI.UserControls.TextEditor txtHtmlEditor;

...

You can just set or get the .Text property to initialize or get the content.

txtHtmlEditor.Text = "<p>Html Content</p>";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM