<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>.toString() &#187; RichTextBox Tinymce javascript asp.net c#.net WYSIWYG</title>
	<atom:link href="http://www.dottostring.com/tag/richtextbox-tinymce-javascript-aspnet-cnet-wysiwyg/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dottostring.com</link>
	<description>Programming is our passion</description>
	<lastBuildDate>Sun, 04 Oct 2009 15:57:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to add JavaScript WYSIWYG Editor ( Rich TextBox )in ASP.NET Website</title>
		<link>http://www.dottostring.com/2008/11/how-to-add-javascript-wysiwyg-editor-richtextbox-in-aspnet-website/</link>
		<comments>http://www.dottostring.com/2008/11/how-to-add-javascript-wysiwyg-editor-richtextbox-in-aspnet-website/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 23:11:34 +0000</pubDate>
		<dc:creator>babarjehangir</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[RichTextBox Tinymce javascript asp.net c#.net WYSIWYG]]></category>

		<guid isPermaLink="false">http://www.dottostring.com/?p=62</guid>
		<description><![CDATA[
for now there is no support for adding Rich Textbox (JavaScript WYSIWYG Editor ) by asp.net framework, but thanks to TinyMCE, its not a problem anymore. I will go through a simple sample asp.net application to integrate TinyMCE RichTexBox.


Download TinyMCE (Developers Version ) from their website.
Create a new asp.net website


copy the tinymce folder located above [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>for now there is no support for adding Rich Textbox (JavaScript WYSIWYG Editor ) by asp.net framework, but thanks to TinyMCE, its not a problem anymore. I will go through a simple sample asp.net application to integrate TinyMCE RichTexBox.</li>
</ul>
<ul>
<li>Download <a href="http://tinymce.moxiecode.com/download.php" target="_blank">TinyMCE (Developers Version )</a> from their website.</li>
<li>Create a new asp.net website</li>
</ul>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-63" title="new-website-tinymce" src="http://www.dottostring.com/wp-content/uploads/2008/11/new-website-tinymce.jpg" alt="An illustration of the adding new website" width="500" height="330" /><p class="wp-caption-text">An illustration of the adding new website</p></div>
<ul>
<li>copy the tinymce folder located above in the working directory of this website and refresh the folder by right-clicking the project in the solution explorer.</li>
</ul>
<p><img class="aligncenter size-full wp-image-64" title="project-view" src="http://www.dottostring.com/wp-content/uploads/2008/11/project-view.jpg" alt="" width="500" height="368" /></p>
<ul>
<li>now we reference the tinymce javascript eidtor which renders a textarea and changes it into a WYSIWYG Edit/RichTextBox by adding the following script in head tag</li>
</ul>
<pre name="code" class="javascript">&lt;script type="text/javascript" src="tiny_mce/tiny_mce.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "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",

// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,

// Example content CSS (should be your site CSS)
content_css : "css/content.css",

// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",

// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
&lt;/script&gt;</pre>
<ul>
<li>the above script actually renders any textarea into a richtextbox which appears in body, so now adding a textarea with an ID and runat=&#8221;server&#8221; tag so that we can access it on the server side on a  button click event.</li>
</ul>
<pre name="code" class="html">&lt;textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%" runat="server"&gt;
&lt;/textarea&gt;
&lt;br /&gt;
&lt;asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /&gt;</pre>
<ul>
<li>Also add the following code in the button click event</li>
</ul>
<pre name="code" class="c#">protected void Button1_Click(object sender, EventArgs e)
{
String HTMLText = elm1.Value;
int a = 0;
}</pre>
<ul>
<li>we are pretty much done, but there is a little problem here. this textarea is now supposed to send HTML through the request object and when the request is parsed by the framework it marks it has malicious and the request will eventually fail, so in order to make the parser ignore this content we have to put ValidateRequest=&#8221;false&#8221; attribute in the page directive tag. Now we are good to go, run the website.</li>
</ul>
<div id="attachment_67" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-67" title="rich-text-box-demonstration" src="http://www.dottostring.com/wp-content/uploads/2008/11/rich-text-box-demonstration1.jpg" alt="An illustration of Rich Text Box ( WYSIWYG )" width="500" height="350" /><p class="wp-caption-text">An illustration of Rich Text Box ( WYSIWYG )</p></div>
<ul>
<li>now add a break point on the first line of the button click event to see what is posted back to the server from this textarea</li>
</ul>
<div id="attachment_68" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-68" title="rich-text-box-demonstration-2" src="http://www.dottostring.com/wp-content/uploads/2008/11/rich-text-box-demonstration-2.jpg" alt="" width="500" height="367" /><p class="wp-caption-text">An illustration of HTML posted back by the Rich Text Box</p></div>
<ul>
<li>Quite simple, isn&#8217;t it <img src='http://www.dottostring.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>here is the code for this sample, <a href="http://www.dottostring.com/wp-content/uploads/2008/11/dottostringrichtextbox.zip">Download</a></li>
<li>Enjoy !</li>
</ul>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.dottostring.com%2F2008%2F11%2Fhow-to-add-javascript-wysiwyg-editor-richtextbox-in-aspnet-website%2F';
  addthis_title  = 'How+to+add+JavaScript+WYSIWYG+Editor+%28+Rich+TextBox+%29in+ASP.NET+Website';
  addthis_pub    = 'erfaan';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.dottostring.com/2008/11/how-to-add-javascript-wysiwyg-editor-richtextbox-in-aspnet-website/feed/</wfw:commentRss>
		<slash:comments>52</slash:comments>
		</item>
	</channel>
</rss>
