Version 2.3.2
License
The license agreement is contained in License.htm.
Introduction
This control is designed specifically for ASP.NET AJAX.
Features
- Server control implements IScriptControl
- Client control extends Sys.UI.Control
- Self-contained with resources embedded in the assembly
- Configuration and Event properties exposed through Visual Studio
Getting Started
The zip file should be extracted to a new folder. For
both ASP.NET 2.0 (Visual Studio 2005) and ASP.NET 3.5
(Visual Studio 2008) configurations, it includes:
- The
Winthusiasm.HtmlEditor control project
- A sample website that uses the
HtmlEditor control
- A solution that contains both
System Requirements
If ASP.NET 2.0 is installed
- ASP.NET AJAX Extensions 1.0 must be installed
- Site must be ASP.NET AJAX enabled
If ASP.NET 3.5 is installed
- Site must be ASP.NET AJAX enabled
Supported Browsers
- Internet Explorer 6+
- Firefox 1.5+
- Opera 9+
Included Folders and Files
The zip file includes separate folders for ASP.NET 2.0 and
ASP.NET 3.5 configurations. Each configuration folder also contains
an appropriate solution file.
Release Folder
- Winthusiasm.HtmlEditor.dll
Site Folder
- Demo.aspx
- Demo.aspx.cs
- Demo.full.aspx
- Demo.full.aspx.cs
- Web.config
Site/Emotions Folder
Site/ImageBrowser/Aspx Folder
- ImageUpload.aspx
- Web.config
Site/ImageBrowser/Images Folder
- Example folder
- Example image file
Winthusiasm.HtmlEditor Folder
- Source files for the
Winthusiasm.HtmlEditor control project
Other
- License.htm
- Readme.htm
- ServerReference.chm
Using the Code
- Double-click the solution file to open the solution in Visual Studio 2005 or Visual
Studio 2008
- Select Build/Rebuild Solution from the menu. This will build the project and copy
the project DLL to the Bin folder of the sample website.
- Set Demo.aspx as the Start Page
- Press F5
Site Installation
Required Steps
- Copy Winthusiasm.HtmlEditor.dll to the Bin folder of your site
- Add a Register statement for the HtmlEditor to the top of the page
- Add a Custom Tag for the HtmlEditor to the page
Use Model
- Use the Text property to set the editor HTML
- Save the HTML when appropriate
- Use the Text property to get the "saved" HTML
Use Model Details: Saving the HTML when Appropriate
The editor's "client-side" Save
method instructs the editor to store the current HTML (converting to XHTML if appropriate)
and clears the modified flag. When
the editor property AutoSave is
set to true (the default), the
client-side Save method is called
automatically as part of the client-side ASP.NET validation process
before the form is submitted. All controls with a
CausesValidation property set to true
(the default) trigger the behavior.
If the AutoSave implementation
is not appropriate or sufficient, the client script to trigger the client-side
Save can be attached through the
optional SaveButtons property or
manually.
Use Model Details: Emotions
To include the Emotions button in the toolbar perform these additional steps:
- Copy the emotions images to a folder on the site
- Set the
EmotionsFolder property to that location (e.g. ~/Images/Emotions)
- Modify the
Emotions property if the images are not the default set
- Include the Emotions button in the
Toolbars property where appropriate
Use Model Details: Image Browser
To enable the Image Browser functionality perform these additional steps:
Required Steps
- Create a folder for ImageUpload.aspx (e.g. ImageBrowser/Aspx)
- Copy ImageUpload.aspx to that folder
- Create a dedicated folder for uploaded images (e.g. ImageBrowser/Images)
- Set the AspxDirectory property to the location of ImageUpload.aspx
- Set the ImagesDirectory property to the dedicated folder
Recommended Steps
- Copy the appropriate Web.config file to the ImageUpload.aspx folder
- Modify its maxRequestLength configuration property
- Set other Image Browser properties as appropriate
Web.config and maxRequestLength
The httpRuntime configuration property
maxRequestLength determines the
ASP.NET maximum size (in KB) of any page request, including uploaded file data.
Requests larger than this length throw an exception on the server in ASP.NET. The
Image Browser catches the
maxRequestLength exception in the ImageUpload.aspx
page error handler and reports the error in the Upload UI as:
"File is too large for the system to upload"
By placing a dedicated Web.config file in the ImageUpload.aspx folder, the site
can specify the maximum size of any upload, albeit including other page data. See
the example Web.config file in the ImageUpload.aspx folder.
Note that the
maxRequestLength limit should be set in addition to the
MaxUploadFileSizeInKB
Image Browser property. In most cases the
maxRequestLength configuration
property should be set just slightly higher than the
MaxUploadFileSizeInKB.