Using Ueditor in ASP.

Source: Internet
Author: User

I. Configuration method 1. Download the. NET version of Ueditor after the extract is put into the project folder. 2. Add "Newtonsoft" to the project. Json.dll "Reference 3. Configure the URL for your project path in the Ueditor configuration file (/ueditor/editor_config.js)

  //Add a path to the editor instance, this cannot be commented

ueditor_home_url:/ueditor/

4. Reference the JS file on the page that needs to use Ueditor

<script type= "Text/javascript" src= ". /ueditor/ueditor.config.js "></script>
<script type= "Text/javascript" src= ". /ueditor/ueditor.all.js "></script>
<link rel= "stylesheet" href= ". /editor/themes/default/dialogbase.css "/>

5. Call Ueditor on pages that need to use Ueditor

<textarea id= "myeditor" name= "Myeditor" runat= "Server" onblur= "Setueditor ()" style= "width:1030px;
height:250px; "disabled=" Disabled "></textarea>

<script type= "Text/javascript" >
var editor = new Baidu.editor.ui.Editor ();
Editor.render ("<%=myeditor. Clientid%> ");
</script>

Note: The red part is the ID of the control that called Ueditor

Two. How to operate 1. Set read-only

var ue=new UE.ui.Editor ({readonly:true,})

2. Get the contents of Ueditor

String text= server.htmldecode ( myeditor. InnerHtml);

3. Modify the toolbar

var ue= new Baidu.editor.ui.Editor ({toolbars: [' Bold ', ' undo ', ' Redo ']});

Enter the toolbar control you want in square brackets, and if [] leave blank, the toolbar is not displayed and can be used for simple viewing

Using Ueditor in ASP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.