AJAX Extender for TinyMCE continued
The code for this article and a sample website can be downloaded here. An online version of the sample website can also be found at http://www.cdevos.nl/examples/example1.aspx.
This article is a continuation of the previous AJAX Extender for TinyMCE which can be found http://weblogs.asp.net/cjdevos/archive/2008/03/03/ajax-extender-for-tinymce-including-fix-for-updatepanels.aspx
The download provided does not contain tinymce. Please download it seperately.
After I published the previous AJAX Extender it got quite some attention, questions and remarks and was obviously wanted by the community. Because of this reason and my own frustrations with the limitations of the current extender I used some spare time to create a new version with options to easily configure a tinymce editor on any textarea element, totally independent of the other element.
The results of all the work can be found in the sample website.
All there is to adding a tinymce editor to any textarea element looks like:
<asp:textbox runat="server" TextMode="MultiLine" id="Textbox1" Text="This is some content that will be editable with TinyMCE." />
<tm:TinyMCETextBoxExtender ID="TinyMCETextBoxExtender1"
runat="server"
TargetControlId="content"
/>
Customization of the control can be obtained by using the InitList property and adding the elements much like:
<asp:textbox runat="server" TextMode="MultiLine" id="content" Text="This is some content that will be editable with TinyMCE." />
<tm:TinyMCETextBoxExtender ID="TinyMCETextBoxExtender1"
runat="server"
TargetControlId="content"
Theme="advanced"
>
<InitList>
<tm:TinyMCETextBoxInit Var="Plugins" Value="safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template" />
<tm:TinyMCETextBoxInit Var="Theme_Advanced_Buttons1" Value="bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink" />
<tm:TinyMCETextBoxInit Var="Theme_Advanced_Buttons2" Value="" />
<tm:TinyMCETextBoxInit Var="Theme_Advanced_Buttons3" Value="" />
<tm:TinyMCETextBoxInit Var="Theme_Advanced_Buttons4" Value="" />
<tm:TinyMCETextBoxInit Var="Theme_Advanced_Toolbar_Location" Value="Top" />
<tm:TinyMCETextBoxInit Var="Theme_Advanced_Toolbar_Align" Value="Left" />
<tm:TinyMCETextBoxInit Var="Theme_Advanced_Statusbar_Location" Value="Bottom" />
<tm:TinyMCETextBoxInit Var="Extended_Valid_Elements" Value="a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]" />
</InitList>
</tm:TinyMCETextBoxExtender>
And it gets even better when you put the above in a .skin file
<asp:textbox runat="server" TextMode="MultiLine" id="content" Text="This is some content that will be editable with TinyMCE." />
<tm:TinyMCETextBoxExtender ID="TinyMCETextBoxExtender1"
runat="server"
TargetControlId="content"
SkinID="CustomSkin"
/>