The Editize™ ASP.NET API Reference

This section of the manual documents in detail all the properties and methods of the Editize API for ASP.NET.

To create an Editize field in a Web Form, first ensure that the EditizeDotNet.dll has been placed in the bin folder in the root of the current Web Application (note: Visual Studio .NET will do this for you automatically). Then load the Editize Server Control:

<%@ Register TagPrefix="SitePoint" Namespace="EditizeDotNet" Assembly="EditizeDotNet" %>

You can then create an Editize field using the SitePoint:Editize tag:

<SitePoint:Editize runat="server" id="example"></SitePoint:Editize>

The following sections list the various attributes and event handlers that you can assign to the SitePoint:Editize tag.

Basic Properties

ID
(Required) As shown above, the ID attribute uniquely identifies the Editize field in your page, so that you can access the content that users edit with it.

E.g.: As a tag attribute:

<SitePoint:Editize runat="server" id="MyEditize" />

E.g.: As an object property in C#:

MyEditize.ID = "MyEditize";
Width
(Default: "600px") Specifies the width of the Editize field. May be specified in pixels or as a percentage of available width.
E.g.: As a tag attribute:

<SitePoint:Editize runat="server" id="MyEditize" width="400px" />

E.g.: As an object property in VB.NET:

MyEditize.Width = new Unit("600px")
Height
(Default: "600px") Same as Width, but specifies the height of the Editize field.

E.g.: As a tag attribute:

<SitePoint:Editize runat="server" id="MyEditize" height="400px" />

E.g.: As an object property in C#:

MyEditize.Height = new Unit("600px");
Codebase
(Default: ".") A relative or absolute URL. Specifies the directory where the Editize JAR files and license file(s) may be found on your site. Editize may not work properly if its files are stored in a password-protected directory of your Web server (the user may be prompted, possibly repeatedly, for the username and password to access the files). By placing them in an unprotected directory and then setting this property to point to that directory, you can use Editize on password-protected pages.
E.g.: As a tag attribute:

<SitePoint:Editize runat="server" id="MyEditize" codebase="/editize/" />
Content
(Default: "") The HTML content in the control. By setting this value, you can present the user with a document to edit. By retrieving this value, you can obtain the document that the user created. When this value has changed following a form submission, the control fires a ContentChanged event (see Control Events below).
E.g.: As a tag attribute:

<SitePoint:Editize runat="server" id="MyEditize" content="&lt;p&gt;Document here&lt;/p&gt;" />

E.g.: As an object property in VB.NET:

MyEditize.Content = "<p>Document here</p>";

Feature Set Configuration Properties

The properties in this section are all of type bool, and may all be set to either true or false to enable or disable the feature in question.

E.g.: Disabling paragraph styles with a tag attribute:

<SitePoint:Editize runat="server" id="MyEditize" paragraphstyles="false" />

E.g.: Disabling inline code by setting an object property in C#:

MyEditize.InlineCode = false; // Disables inline code

Unless otherwise indicated, these properties default to true.

About
If true, the pop-up menu in Editize will contain a "About Editize" menu item, which opens the Editize Web site in a new browser window when selected. If false, the menu item does not appear.
EditButtons
If true, the user has access to the standard edit features (cut, copy, paste, undo, redo) through buttons on the toolbar. If false, the buttons do not appear, but the features remain available through the pop-up menu and keyboard shortcuts.
CodeView
This property defaults to false. If true, the user has access to a 'Code View' tab that displays the underlying HTML code of the document for direct editing.
FormElementsAllowed
This property defaults to false. If true, the user may insert form elements (including form, input, select and textarea tags) by pasting HTML content from the clipboard, or by typing them into the 'Code View' tab. Otherwise, these tags are stripped out when reading in HTML content.
ParagraphStyles
If true, the user can select paragraph styles from a drop-down menu in the toolbar.
HeadingStyle
If true, the Heading style is available in the paragraph style dropdown.
SubheadingStyle
If true, the Subheading style is available in the paragraph style dropdown.
InsetStyle
If true, the Indent and Outdent buttons will be available in the toolbar.
MonospacedStyle
If true, the Monospaced style is available in the paragraph style dropdown.
ParagraphAlignments
If true, the user can choose to make paragraphs (except for Monospaced paragraphs) Left, Center, or Right aligned. If false, all paragraphs are Left aligned.
BulletLists
If true, the user can create bullet lists with a button on the toolbar.
NumberedLists
If true, the user can create numbered lists with a button on the toolbar.
BoldText
If true, the user can create bold text with a button on the toolbar, or with a keyboard shortcut (Ctrl-B).
ItalicText
If true, the user can create italic text with a button on the toolbar.
UnderlineText
If true, the user can create underlined text with a button on the toolbar, or with a keyboard shortcut (Ctrl-U).
HighlightText
If true, the user can create highlighted text (<span class="highlighted">) with a button on the toolbar.
InlineCode
If true, the user can create inline code (<code>) with a button on the toolbar, or with a keyboard shortcut (Alt-C).
Hyperlinks
If true, the user can create and remove hyperlinks with a button on the toolbar. The user may choose whether a link loads in the default window, or in a new window (<a href="..." target="_blank">).
Images
If true, the user can create and edit images with a button on the toolbar. The user may provide an absolute or relative URL to the image file to be inserted. Relative URLs are resolved based on the BaseURL property, described below.
Tables
If true, the user can create tables with a button on the toolbar.

Display Properties

These properties let you configure Editize to display a document with the same character styles that you use on your site. In this way, the WYSIWYG editing interface presented by Editize can be made to exactly match the look the content will have when displayed as part of your site.

AppletBgColor
(Default: default system background color) Specifies the background color that should be displayed around the Editize applet. When the CodeView feature is enabled, this property controls the color of the area surrounding the WYSIWYG and Code View tabs. When the ShowSubmitButton feature is enabled, this property controls the color of the area surrounding the Java submit button. This does not affect the background color of the document displayed in the applet (see BGColor below for that); only of the applet itself. The value is specified as an HTML color code ("#RRGGBB"), or as an HTML standard color name.
BaseURL
(Default: none) Specifies the base URL for images and hyperlinks in the document. Typically, you should set this to the same base URL that the finished document will be displayed with on your Web site. For example, if the finished document will be displayed by http://www.mysite.com/site/content.asp, you should set the base URL to http://www.mysite.com/site/. By so doing, you can tell Editize to insert an image with the URL graphics/mylogo.gif and it will find the image file at http://www.mysite.com/site/graphics/mylogo.gif.
BGColor
(Default: white) Specifies the background color that should be displayed within the text entry area of the Editize applet. The value is specified as an HTML color code ("#RRGGBB"), or as an HTML standard color name.
BaseFontFace
(Default: "Times New Roman") Specifies the font face for Normal text in the Editize form field. All other character and paragraph styles except Monospaced and Inline Code will inherit this font face by default as well. You may specify a single font family (e.g. "Verdana"), or one of the following logical font names: "Dialog", "DialogInput", "Monospaced", "Serif", "SansSerif", or "Symbol".
BaseFontSize
(Default: 16) Specifies the font size for Normal text in the Editize form field. All other character and paragraph styles except Heading and Subheading will inherit this font size by default as well. The value is specified as an integer (int) in pixels.
BaseFontColor
(Default: "#000000") Specifies the font color for Normal text in the Editize form field. All other character and paragraph styles except hyperlinks will inherit this font color by default as well. The value is specified as an HTML color code ("#RRGGBB"), or as an HTML standard color name.
HeadFontFace
(Default: inherited) Specifies the font face for Heading style text in the Editize form field. See BaseFontFace for details.
HeadFontSize
(Default: 32) Specifies the font size for Heading style text in the Editize form field. See BaseFontSize for details.
HeadFontColor
(Default: inherited) Specifies the font color for Heading style text in the Editize form field. See BaseFontColor for details.
SubheadFontFace
(Default: inherited) Specifies the font face for Subheading style text in the Editize form field. See BaseFontFace for details.
SubheadFontSize
(Default: 24) Specifies the font size for Subheading style text in the Editize form field. See BaseFontSize for details.
SubheadFontColor
(Default: inherited) Specifies the font color for Subheading style text in the Editize form field. See BaseFontColor for details.
InsetFontFace
(Default: inherited) Specifies the font face for indented blocks in the Editize form field. See BaseFontFace for details.
InsetFontSize
(Default: inherited) Specifies the font size for indented blocks in the Editize form field. See BaseFontSize for details.
InsetFontColor
(Default: inherited) Specifies the font color for indented blocks in the Editize form field. See BaseFontColor for details.
MonospacedBackgroundColor
(Default: none) Specifies the background color for Monospaced paragraphs. Generally used to shade code blocks to set them apart from the rest of the text. The value is specified as an HTML color code ("#RRGGBB"), or as an HTML standard color name.
HighlightColor
(Default: "#FF0000") For the highlighted text feature to work, you must specify a font color for highlighted text with this property. The value is specified as an HTML color code ("#RRGGBB"), or as an HTML standard color name.
LinkColor
(Default: "#0000FF") Specifies the text color for hyperlinked text in the Editize form field. The value is specified as an HTML color code ("#RRGGBB"), or as an HTML standard color name.
LinkUrls
(Default: "") Lets you provide a list of suggested link URLs, which will appear in the hyperlink dialog box in a drop-down list. Users can then select URLs from that list and then edit them if they wish, or type their own URLs from scratch as well. This value should be specified as string that contains a comma-separated list of URLs.

E.g. As a tag attribute:
<SitePoint:Editize runat="server" id="MyEditize"
  linkurls="mailto:,http://www.sitepoint.com/article.php" />
E.g. As an object property in C#:

// Provide two suggested link URLs for users
MyEditize.LinkUrls="mailto:,http://www.sitepoint.com/article.php";

Special Purpose Properties

ImgListUrl

If this property is set to a URL, Editize will download a list of images from this address and present it to the user in the Insert Image dialog. The given URL may refer to a server-side script (e.g. to provide an up-to-date list of images stored in a content management system), but the output must be plain text of the following format:
url1 Description of the first image
url2 Description of the second image
url3 Description of the third image
...
Each line should contain a URL optionally followed by a description of the image. The description (if specified) will both appear in the image list and be used as the default value for the alt attribute if the image is selected. If no description is provided, the URL of the image will appear in the list instead.
LicenseFileExt
(Default: "lic")

Allows you to specify the file extension that Editize uses when looking for its license file on your server. We have had reports that pre-release versions of Windows 2003 Server will prevent files with a .lic extension from being downloaded. If you encounter this issue, you can simply rename your Editize license file to, say editize.myhost.com.key and set this property to "key" so that Editize can find it.

Control Events

The Editize ASP.NET Server Control supports a single event (of type EventHandler), which is triggered each time the content in the control has been changed following a form submission.

ContentChanged
Each time an ASP.NET page is submitted to the server, the Editize Server Control checks if its contents have changed and updates its Content property appropriately. Whenever this occurs, a ContentChanged event is raised by the Control. You can set your own method to handle this event to react to changes the user makes to the content. Detailed examples of this are provided in the sample ASP.NET pages provided with this distribution (in the /aspdotnet/samples directory).

Example: As a tag attribute:
<SitePoint:Editize runat="server" id="MyEditize"
  onContentChanged="MyEditize_ContentChanged" />
<script language="C#" runat="server">
public void MyEditize_ContentChanged(object sender, EventArgs e)
{ // React to the event... }
</script>
Example: As code in C#:
<script language="C#" runat="server">
private void Page_Load(object sender, EventArgs.e) { MyEditize.ContentChanged += new EventHandler(MyEditize_ContentChanged);
} public void MyEditize_ContentChanged(object sender, EventArgs e) { // React to the event... } </script>