Baidu Rich Text editor Ueditor

Source: Internet
Author: User

Objective

  Configuring the. NET Mvc4 Project uses the Ueditor Editor to document the solution by encountering several issues during configuration. The editor can download the. NET Development package to Http://ueditor.baidu.com/website/download.html#ueditor, for example, I downloaded the 1.2.6.1net version of the development package.

Configuration:

1, put the development package into the MVC4 project, in my project I put in the content directory

2. Introduce JS and style files in the template page:

3, in the page configuration initialization editor, in the page configuration textarea display as editor, the editor more parameter settings can refer to ueditor.config.js inside the configuration instructions:

@using (Html.BeginForm ()) {<textareaID= "Editor"name= "Editor"></textarea>    <inputtype= "Submit"value= "Submit" />} @section scripts{<Scripttype= "Text/javascript">        varEditor= NewBaidu.editor.ui.Editor ({ueditor_home_url:'/content/ueditor/',//Configure editor PathIframecssurl:'/content/ueditor/themes/iframe.css',//Style pathinitialcontent:'Welcome to use Ueditor',//Initializing editor Contentautoheightenabled:true,//High automatic growthMinframeheight: -//min. height        }); Editor.render ('Editor'); </Script>    }

By this point, the page has already shown the editor's appearance,

4, to solve the picture upload problem, by viewing the Ueditor configuration file and imageup.ashx it is obvious that the editor will put the picture into the Uditor/net/upload or Upload1 folder, if not exist, create a folder, The upload image will be prompted with a network connection error, viewing the error via F12

View the default properties of the uploader file to compile, change its properties to content after re-running the program, the picture uploaded successfully, such as:

5. Troubleshoot form submission errors, starting with the. Net Framework 4.0, ASP. NET starts to force detection of the request parameter security , the following error occurs when the direct commit

This issue is resolved in the background action tag [ValidateInput (false)],

6, editor and other content we can receive through formcollection, so as to achieve content preservation, processing pictures and other related operations

The above is the Baidu editor in the MVC project of the simple configuration, personal feeling is still very useful, has been used in a number of projects, no feeling like a lot of people say that not so good, but the individual feels nice.

Baidu Rich Text editor Ueditor

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.