asp.net version Baidu editor Ueditor deployment usage Instructions

Source: Internet
Author: User
Tags bz2 rand rar zip

1. For more details on ueditor, please go to the official to see the API.

Ueditor-Home

http://ueditor.baidu.com/website/

2, open vs2010 (other version similar), a new blank site,
3, open a new site all in the directory, will just download a good Baidu editor files in a folder, I have here folder name: "Ueditor"
4, cut the "ueditor"-"net"-"App_Code" folder and "Bin" folder into the root directory, as shown in the following illustration:


5, open the "ueditor"-"net" folder under the Web.config file, the following figure in the red box cut to the root Web.config corresponding position
Finally, the contents of the web.config in the root file are shown in the following illustration

Also, delete the Web.config file under the "Ueditor"-"NET" folder

6, open "Ueditor" under the Ueditor.config.js file, find "Serverurl:url +" Net/controller.ashx "",
Change the contents to: "Serverurl:url +". /ueditor/net/controller.ashx ""


7, open the "ueditor"-"net" folder under the Config.json file
Here are all uploaded image paths, file path settings, I will only describe a picture here, the other methods are similar
Change the contents of "Imageurlprefix": "/ueditor/net/" to "Imageurlprefix": "",
"Imagepathformat": "Upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", "Change to" "Imagepathformat": "/upload/image/{yyyy}{ Mm}{dd}/{time}{rand:6} ","

8, create the "upload" folder under the root, at the same time, create three subfolders under the "Upload" folder: "Image" (for storing pictures), "video" (for storing videos), "File" (for storing files), the file can be set more heart name, But to be consistent with the path settings for step 7th, as shown in the following figure

9, add a new form, the Test editor use

Here's my front end code.


<%@ Page language= "C #" autoeventwireup= "true" codefile= "Default.aspx.cs" inherits= "_default"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title></title>
<script type= "Text/javascript" src= ". /ueditor/ueditor.config.js "></script>
<!--editor source file-->
<script type= "Text/javascript" src= ". /ueditor/ueditor.all.js "></script>

<body>
<form id= "Form1" runat= "Server" >
<div>
<asp:textbox id= "Container" runat= "Server" textmode= "MultiLine" name= "container"
Clientidmode= "Static" style= "width:800px;height:800px";></asp:textbox>
<!--instantiation Editor-->
<script type= "Text/javascript" >
var UE = ue.geteditor (' container ');
</script>
</div>
</form>
</body>

10, the last step, change the path of the Web site run, do not need to prefix the path


Select site root name, point attribute
Delete the virtual path in the picture, leaving only the "/"

Annex: Config.json


/* Front and back end communication related configuration, note only allowed to use multiple lines * *
{
/* Upload Picture configuration Item * *
"Imageactionname": "Uploadimage",/* Execute the action name of the uploaded image/*
"Imagefieldname": "Upfile", * * submitted picture form name * * *
"Imagemaxsize": 2048000,/* Upload size limit, Unit b * *
"Imageallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp"],/* Upload picture format display * *
' Imagecompressenable ': true,///compression of the picture, default is True/*
"Imagecompressborder": 1600,/* picture compression maximum edge limit * *
"Imageinsertalign": "None", * * Insert the picture floating mode * *
"Imageurlprefix": "",/* Image access Path prefix * *
"Imagepathformat": "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, you can customize the save path and file name format * *
/* {filename} will be replaced by the original filename, configure this need to pay attention to the Chinese garbled problem * *
/* {RAND:6} will replace the random number, followed by the number of random number of digits * *
/* {time} will be replaced with a timestamp * *
/* {YYYY} will be replaced by four-bit year * *
/* {YY} will be replaced by two-bit year * *
/* {mm} will be replaced by two-digit month * *
/* {DD} will be replaced with two-digit date.
* * {HH} will be replaced by two-hour/
/* {II} will be replaced by two-bit minutes */
/* {SS} will be replaced by two-bit seconds * *
/* Illegal characters \: *? "< > | */
* * Please look at the online document: fex.baidu.com/ueditor/#use-format_upload_filename * *
* * Graffiti Picture Upload configuration Item * *
"Scrawlactionname": "Uploadscrawl", * * Execute the name of the action to upload graffiti * *
"Scrawlfieldname": "Upfile", * * submitted picture form name * * *
"Scrawlpathformat": "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, you can customize the save path and file name format * *
"Scrawlmaxsize": 2048000,/* Upload size limit, Unit b * *
"Scrawlurlprefix": "",/* Image access Path prefix * *
"Scrawlinsertalign": "None",
/* screenshot tool upload/*
"Snapscreenactionname": "Uploadimage", * * Execute upload screenshot of the action name * *
"Snapscreenpathformat": "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, you can customize the save path and file name format * *
"Snapscreenurlprefix": "",/* Image access Path prefix * *
"Snapscreeninsertalign": "None", * * Insert the picture floating mode * *
/* Crawl Remote picture configuration * *
"Catcherlocaldomain": ["127.0.0.1", "localhost", "img.baidu.com"],
"Catcheractionname": "Catchimage",/* Execute the action name of the crawl remote picture * *
"Catcherfieldname": "Source", * * submitted picture List Form name * *
"Catcherpathformat": "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, you can customize the save path and file name format * *
"Catcherurlprefix": "",/* Image access Path prefix * *
"Catchermaxsize": 2048000,/* Upload size limit, Unit b * *
"Catcherallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp"],/* Grab picture format Display * *
/* Upload Video Configuration * *
"Videoactionname": "Uploadvideo",/* Execute the action name of the upload video * *
"Videofieldname": "Upfile", * * submitted video form name * * *
"Videopathformat": "/upload/video/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, you can customize the save path and file name format * *
"Videourlprefix": "",/* Video access Path prefix * *
"Videomaxsize": 102400000,/* Upload size limit, Unit B, default 100MB * *
"Videoallowfiles": [
". flv", ". SwF", ". mkv", ". avi", ". Rm", ". rmvb", ". Mpeg", ". mpg",
". Ogg", ". Ogv", ". mov", ". wmv", ". mp4", ". WebM", ". mp3", ". wav", ". Mid"],/* Upload video format display * *
/* Upload file Configuration * *
"Fileactionname": "UploadFile",/* Controller, execute the action name of the upload video * *
"Filefieldname": "Upfile", * * submitted document form name * *
"Filepathformat": "/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}",/* Upload save path, you can customize the save path and file name format * *
"Fileurlprefix": "",/* File access Path prefix * *
"Filemaxsize": 51200000,/* Upload size limit, Unit B, default 50MB * *
"Fileallowfiles": [
". png", ". jpg", ". jpeg", ". gif", ". bmp",
". flv", ". SwF", ". mkv", ". avi", ". Rm", ". rmvb", ". Mpeg", ". mpg",
". Ogg", ". Ogv", ". mov", ". wmv", ". mp4", ". WebM", ". mp3", ". wav", ". Mid",
". rar", ". zip", ". Tar", ". Gz", ". 7z", ". bz2", ". Cab", ". ISO",
". Doc", ". docx", ". xls", ". xlsx", ". ppt", ". pptx", ". pdf", ". txt", ". MD", ". xml"
],/* Upload file format display * *
/* List the pictures under the specified directory * *
"Imagemanageractionname": "ListImage",/* Execute Picture Management action name * *
"Imagemanagerlistpath": "/upload/image",/* Specify the directory to which you want to list the pictures * *
"Imagemanagerlistsize": 20,/* The number of documents per list * *
"Imagemanagerurlprefix": "",/* Image access Path prefix * *
"Imagemanagerinsertalign": "None", * * Insert the picture floating mode * *
"Imagemanagerallowfiles": [". png", ". jpg", ". jpeg", ". gif", ". bmp"],/* listed file Types * *
/* List files in the specified directory/*
"Filemanageractionname": "ListFile",/* Execute File Management action name * *
"Filemanagerlistpath": "/upload/file",/* Specifies the directory to which you want to list files * *
"Filemanagerurlprefix": "",/* File access Path prefix * *
"Filemanagerlistsize": 20,/* The number of documents per list * *
"Filemanagerallowfiles": [
". png", ". jpg", ". jpeg", ". gif", ". bmp",
". flv", ". SwF", ". mkv", ". avi", ". Rm", ". rmvb", ". Mpeg", ". mpg",
". Ogg", ". Ogv", ". mov", ". wmv", ". mp4", ". WebM", ". mp3", ". wav", ". Mid",
". rar", ". zip", ". Tar", ". Gz", ". 7z", ". bz2", ". Cab", ". ISO",
". Doc", ". docx", ". xls", ". xlsx", ". ppt", ". pptx", ". pdf", ". txt", ". MD", ". xml"
]/* The file types listed * *
}

Related Article

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.