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 </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