TinyMCE's use in Asp. Net is actually quite simple, download TinyMCE from the official website), and then copy the jscripts directory to your website directory.
Suppose you need to use the editor somewhere on your aspx page, add
<Asp: TextBox ID = "brand" TextMode = "MultiLine" runat = "server"/>
Add the following content to the header:
<Script src = "../js/tiny_mce/tiny_mce_src.js" type = "text/javascript"> </script>
<Script language = "javascript" type = "text/javascript">
TinyMCE.Init({
Mode: "textareas ",
Theme: "simple"
});
</Script>
Run the page to see an editor, and you can use brand. text to get the value (You may see an error prompt, then you only need. add ValidateRequest = "false" to the <% @ Page at the beginning of aspx)
Of course, if you have multiple textareas on your page, you may only want to replace one with an editor, then the above mode line is changed:
Mode: "exact", elements: "corresponding ID"
For other usage instructions, go to the official website.
----------------------------------------------------------------
Chinese garbled characters:
After TinyMCE's Language Pack is set, it is always abnormal when used in ASP.net, and the content of the Language Pack cannot be read.
After careful research, it turns out that the default HTTPResponse output of ASP.net 2.0 is UTF-8, not Chinese gb2312, or gb18030, HZ, so the settings are correct, however, an error occurs during page execution and the configuration of the Language Pack cannot be correctly read.
We can add the setting statement to Load the Page class to solve this problem.
Response.ContentEncoding = Encoding.GetEncoding("gb2312")
After re-compilation, You can normally read the content in the Chinese language resource package.
-----------------------------------------------------
Related resource collection:
TinyMCE Chinese manual Co., http://www.inpeck.com/TinyMceManual/
Several useful plug-ins in tinymce: http://joom.org.ru/home/article/14-tinymce-plugin.html
Online Editor TinyMCE 3 Simplified Chinese Language Pack: http://www.metalstar.net /? D = 86
Tinymce small Chinese fonts solution http://www.humker.com/2008/03/07/tinymce-chinese-font-size
Made of custom controls: http://www.jonllen.com/jonllen/aspnet/tinymce.aspx
No matter which version of tinymce is used, the default Chinese font is too small. After editing and saving it, the default font becomes quite large.
Solution: In js \ themes \ advanced \ css \ editor_content.css
Body, td, pre {
Font-family: Verdana, Arial, Helvetica, sans-serif;
Font-size: 12px;
}
Change 10px to 12px.