HTML Editor for ASP.NET AJAX
Text Property
Server ReferenceWinthusiasm.HtmlEditorHtmlEditorText
The Text property is used to get and set the editor text.
Declaration Syntax
C#
public string Text { get; set; }
Remarks
This property is used to both get and set the editor text.

To set the text assign an HTML string. If the assignment takes place during an asynchronous postback the editor will detect the change and update the text on the client.

To get the text read the string in an event handler.

Note: The Text property reflects the "Saved" text. The concept of "saving" takes place on the client, and includes the conversion to XHTML if appropriate.

If the AutoSave property is set to true (the default) this takes place automatically as part of the client-side ASP.NET validation process before postback. All controls whose CausesValidation property is set to true (the default) trigger this behavior. If the standard client-side validation process does not take place on postback the editor's client-side Save method should be triggered through one of two methods:

  • The ID of the button control(s) that should trigger the Save should be listed in the SaveButtons property. The editor finds the controls with the ID's listed and automatically modifies their OnClientClick property.
  • The appropriate client-side script can be manually added. In general, the OnClientClick property of the button control(s) should be modified to $find the client-side editor object and call Save.
    CopyC#
    OnClientClick="GetHtmlEditor().Save()"

Examples
Set the text:
CopyC#
Editor.Text = "This is some <strong>initial</strong> text.";
Get the text:
CopyC#
string savedText = Editor.Text;

Assembly: Winthusiasm.HtmlEditor (Module: Winthusiasm.HtmlEditor) Version: 2.3.0.0 (2.3.0.0)