Asp. Using the Ueditor text editor in an MVC project

Source: Internet
Author: User

1. Download the Ueditor source file and import it into the project

2. Add the CSS and JS you want to use in your project

            //ueditor Text Editor prerequisites for Stylebundle and ScriptbundleStylebundle ueditorcss =NewStylebundle ("~/assets/plugins/ueditor/themes/default/css"); Scriptbundle Ueditorjquery=NewScriptbundle ("~/assets/plugins/ueditor"); //add a style to the Ueditor text editorUeditorcss. Include ("~/assets/plugins/ueditor/themes/default/css/ueditor.css"); //Add js for ueditor text editorUeditorjquery. Include ("~/assets/plugins/ueditor/ueditor.config.js",                           "~/assets/plugins/ueditor/ueditor.all.js",                           "~/assets/plugins/ueditor/lang/zh-cn/zh-cn.js");

3. Import to the page you want to use

@section header{@Styles. Render ("~/assets/plugins/ueditor/themes/default/css"  ) @Scripts. Render ("~/assets/plugins/ueditor")}

4. Declare in the text box

                         class="form-group">                            class="Control-label Col-md-2"> Description &nbsp;&nbsp;</label>                            class="  Col-md-8">                                = m.description)                            </div>                        </div >

5. Initialize the text editor

@section footer{    <script>        jQuery (document). Ready (function () {            Layout.setsidebarmenuactivelink ('set', $ ('# @ViewBag. CLASSID ' ));            Ue.geteditor ("Description"); // Initialize Rich Text editor         });     </script>}

6. The final effect is as follows:

Asp. Using the Ueditor text editor in an MVC project

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.