ASP.NET MVC HTML Editor - Properties and events

<%@ Register TagPrefix="ed" Namespace="Obout.Mvc.HTMLEditor" Assembly="Obout.Mvc" %>
All properties can be used inside template XML files, except Template.

Obout.Mvc.HTMLEditor.Editor properties

Name Description
propertyAppearance Obout.Mvc.HTMLEditor.Editor.AppearanceType enumeration. The Editor's appearance type. All possible values of the property:
  • full - Full buttons set
  • lite - Lite buttons set
  • custom - Custom buttons set
Default full. Optional
propertyAutoFocus Bool. Indicates initial Editor focusing.
  • true - get focus
  • false - get no focus
Default true. Optional
propertyCancel Bool. Indicates that Cancel button will be shown or not in the editor's bottom bar.
  • true - show the Cancel button
  • false - don't show the Cancel button
Default false. Optional
propertyCaretPosition Bool. Indicates caret position in content on Editor loaded.
  • true - beginning of content
  • false - end of content
Default false. Optional
propertyCausesValidation Bool. Indicates whether the control's submit causes page validation to occur.

Default true. Optional
propertyClientCancel String. Name of client-side function that will be executed on Cancel button click.
This function has one parameter - client-side Editor object.
This function should return true if you want to continue Cancel operation (ClickCancel server-side event is set). If this function returns false the Cancel operation will be terminated.
propertyClientValidation Bool. By default the RequiredFieldValidator validation control is supported with EnableClientScript="True" only.
  • true - enables supporting of all validation controls with EnableClientScript="True"
  • false - enables supporting of the RequiredFieldValidator validation control with EnableClientScript="True" only
Default false. Optional
propertyContent String. Editor's HTML content. Default empty. Optional
Preferably this property should be set and retrieved in Page_Load method of the Page. If content can be changed on some callback events, use Page_PreRender method of the Page.
propertyCustomDictionaryOnServer Bool. This property specifies the place where custom dictionary will be stored for the spell checker.
  • true - the dictionary will be stored in the server's directory specified with the DictionariesFolder property. The name of the dictionary file is "user.dic", it will be common for all users.
  • false - the dictionary will be stored in client's cookie, so it will be available for this user only.
Default false. Optional
propertyDefaultContextMenu Bool. Enables/disables using of default Editor's context menu.
  • true - enabled
  • false - disabled
Default true.Optional
propertyDefaultFontFamily String. Specifies the default font family used in editing panel of Editor.

By default for this purpose is used "~/Content/Obout/Editor/ed_styles/special/editor.css" styles file.
Optional
propertyDefaultFontSize String. Specifies the default font size used in editing panel of Editor.

By default for this purpose is used "~/Content/Obout/Editor/ed_styles/special/editor.css" styles file.
Optional
propertyDefaultStylesInHtml Bool. Indicates whether to add default styles into content when FullHtml is on.
Default true. Optional
propertyDictionariesFolder String. Path to directory with Editor's spell checker dictionaries.
Default "ed_dictionaries". Optional
propertyFixedToolBar Bool. Indicates Editor's Tool bar behavior on case, when buttons set can not be placed into the Tool bar in corpore. It may be happened when width of Editor component is too small.
  • true - area with extra buttons is hidden
  • false - Tool bar is stretching and all vertical separators are ignored
Default true. Optional
propertyFlashBrowse String. Gets/sets the name of the predefined flashes browser. Default "myFlashBrowse". Optional
propertyFontNotSet Bool. If this property is set to "true", "Not set" will be shown in font dropdowns if font is not set manifestly.

Default false. Optional
propertyFullHTML Bool. Indicates that Editor will generate its content as entire page HTML code with <HTML>, <HEAD> and <BODY> tags.
  • true - generates entire page HTML code
  • false - generates <BODY>'s content only
Default false. Optional
propertyHeight Int. Editor component height in pixels. Default 400. Optional
propertyIconFolder String. Path to directory with Editor's icons subdirectories. Every such subdirectory name appears in TABs of Insert Icon popup window. This window is opened on toolbar's Insert Icon button click. Icon images are contained in these subdirectories. Default "ed_icons". Optional
propertyID String. Component Id.
propertyIgnoreTab Bool. Suppress Tab key navigation inside Editor control.
  • true - Tab key doesn't navigate inside Editor
  • false - navigation as usual
Default false. Optional
propertyImageBrowse String. Gets/sets the name of the predefined images browser. Default "myImageBrowse". Optional
propertyInitialCleanUp Bool. Enables/disables inital(on load) cleanup of Editor's content like button do.
It is actual for client-side setContent() function too.
  • true - enabled
  • false - disabled
Default false. Optional
propertyInsideOboutWindow Bool. This property should be set to "true" when Editor is used inside obout Window.

Default false. Optional
propertyKeyboardEnabled Bool. Enables/disables using of keyboard keys (and text typing too) for Editor's panel in Design mode.
  • true - enabled
  • false - disabled
Default true. Optional
propertyLanguage String. Language name used in Editor component. Every accessible language name is corresponded with <name>.xml file located in LocalizationFolder directory.
User can take file en.xml as a template and create his own localization XML file for his native language (for example de.xml). Default "en". Optional

See also working example.
propertyLocalizationFolder String. Path to directory with localization XML files. Default "ed_localization". Optional
propertyMaxSuggestions Int. Maximum of suggestions for each incorrect word in Spell checker popup window. Default 25. Optional
propertyMediaBrowse String. Gets/sets the name of the predefined medias browser. Default "myMediaBrowse". Optional
propertyModeHTML Bool. Sets initial editing mode on Editor loaded.
  • true - HTML text mode
  • false - Design mode
Default false. Optional
propertyModeSwitch Bool. Indicates that user can switch the editing mode.
  • true - user can use both Design and HTML text editing modes.
  • false - user can use Design editing mode only
Depending on this value the corresponding mode switch buttons will be shown or not in the editor's bottom bar. Default true. Optional
propertyNoDrop Bool. Prohibits any dropping to Editor's panel.
  • true - dropping is prohibited
  • false - dropping is not prohibited
Default false. Optional
propertyNoPaste Bool. Prohibits any pasting (except Plain Text) to Editor's panel in Design mode.
  • true - pasting is prohibited
  • false - pasting is not prohibited
Default false. Optional
propertyNoScript Bool. Indicates that any Java Script code will be suppressed in Editor's content.
  • true - Java Script code is suppressed
  • false - Java Script code is not suppressed
Default false. Optional
propertyNoUnicode Bool. Indicates that Editor's content will contain Unicode characters.
  • false - Editor's content will contain Unicode characters
  • true - Editor's content will contain &#code; instead of Unicode characters
Default false. Optional
propertyOnClientContentChanged String. Name of client-side function called on each content change.
This function has one parameter, its members you can see in the following sample:

<% Html.Obout(new Obout.Mvc.HTMLEditor.Editor("editor1", Page)
   {
     OnClientContentChanged = "myFunc", // name of the client-side function 
     Content = content // initial content
}); %>
...

// Set values of some textboxes on each client-side Editor's content change
//

function myFunc(s)
{
  // total length of HTML before content changed
  document.getElementById("previousTotalHtml").value= s.previous.htmlTextLength;

  // total length of plain text before content changed
  document.getElementById("previousTotalPlain").value= s.previous.plainTextLength;

  // total length of HTML after content changed
  document.getElementById("currentTotalHtml")  .value= s.current.htmlTextLength;

  // total length of plain text after content changed
  document.getElementById("currentTotalPlain")  .value= s.current.plainTextLength;
}

Note: Use of this property makes Editor work a little slower for large content, especially in FireFox.

By default no client-side function is called. Optional
propertyOnCancel String. Server event. Name for the controller called on "CANCEL" button pressed.
Default String.Empty . Optional

Example:
Html.Obout(new Obout.Mvc.HTMLEditor.Editor("editor1", Page)
{
  OnCancel = "Editor/ServerEvents_Canceled",
  Content = content // initial content
});
propertyOnContentChanged String. Server event. Name for the controller called when content was changed in client-side and the form was submitted.
Default String.Empty . Optional

Example:
Html.Obout(new Obout.Mvc.HTMLEditor.Editor("editor1", Page)
{
  OnContentChanged = "Editor/ServerEvents_ContentChanged",
  Content = content // initial content
});
propertyOnSubmit String. Server event. Name for the controller called on "SUBMIT" button pressed. If the OnContentChanged property is set and content was changed in client-side, then this event will not be activated.
Default String.Empty . Optional

Example:
Html.Obout(new Obout.Mvc.HTMLEditor.Editor("editor1", Page)
{
  OnSubmit = "Editor/ServerEvents_Submitted",
  Content = content // initial content
});
propertyPathPrefix String. Path prefix for QuickFormatFolder, StyleFolder, DictionariesFolder and IconFolder directories. Default "~/Content/Obout/Editor/". Optional
propertyPlainText String. Plain text of Editor's content. ReadOnly
propertyPreviewMode Bool. Indicates that Preview button will be shown or not in the editor's bottom bar.
  • true - show the Preview button
  • false - don't show the Preview button
Default false. Optional
propertyPreviewOnInit Bool. Sets Preview mode on Editor loaded. Default false. Optional

See also working example.
propertyQuickFormatFile String. Name of Quick Format CSS file in QuickFormatFolder directory.
Default "QuickFormat.css".Optional
propertyQuickFormatFolder String. Path to directory with Quick Format CSS file. Default "ed_quickformat". Optional
propertyRelImgUrls Bool. Indicates manner of Images's src property representation when relative URL was setted in Image properties popup window.
  • true - relative URL
  • false - absolute URL
Default false. Optional
propertyRemainLfOnSubmit Bool. Indicates whether Editor remain Line feed characters in submitted content.
  • true - Line feed characters will be remained in content
  • false - Line feed characters will be removed
Default false. Optional
propertyRtl Bool. Indicates that right to left direction of content is set initially.
  • true - right to left
  • false - left to right
Default false. Optional
propertyScriptFolder String. Folder with Editor's auxiliary pages. Default "~/EditorScripts/". Optional
propertyScrollIntoView Bool. Indicates that the top of Editor component will be visible on Page load. It is usefull in large pages when Editor is far from page top.
  • true - page scrolls to Editor if it is invisible
  • false - page doesn't scroll to Editor if it is invisible
Default false. Optional
propertyShow Bool. Indicates that Editor component will be initially shown on client side.
  • true - component is shown initialy
  • false - component isn't shown initialy
Default true. Optional
propertyShowAnchors Bool. Indicates that initialy special image will be shown in place of each Anchor in Editor's panel.
  • true - is shown
  • false - isn't shown
Default true.
propertyShowPlaceHolders Bool. Indicates that initialy special image will be shown in place of each PlaceHolder in Editor's panel.
  • true - is shown
  • false - isn't shown
Default true. Optional
propertyShowQuickFormat Bool. Indicates that Quick Formatting panel will be shown in Editor.
  • true - is shown
  • false - isn't shown
Default true. Optional
propertyShowWaitMessage Bool. To show or not "Wait" message in Editor while content is loading or edit mode switching.

Default true. Optional
propertySpellCheckAutoComplete Bool. Gets or sets a value indicating whether to close the SpellChecker popup on spell checking complete just after 'alert' window closed.
Default false. Optional
propertyStyleFile String. Name of the Editor's style file in StyleFolder directory. Default "style.css". Optional
propertyStyleFolder String. Path to directory with Editor's style file and images. Default "ed_styles". Optional
propertySubmit Bool. Indicates that Submit button will be shown or not in the editor's bottom bar.
  • true - show the Submit button
  • false - don't show the Submit button
Default true. Optional
propertySuppressTab Bool. Indicates that Editor will ignore Tab key in Design mode.
  • true - ignores Tab key
  • false - processes Tab key as a set of spaces
Default false. Optional
propertyTabIndex Int. Value of 'tabindex' attribute to be used for editable panels ('Design', 'HTML text') of Editor control.

By default is not set. Optional
propertyTemplate String. Name (without extension) of Editor's template XML file in TemplateFolder directory.
If you set this property, it should be set after PathPrefix and TemplateFolder properties.
This property is the only way to set the collections of the inner HTMLEditor object (HTMLEditor ASP.NET 2.0) such as Buttons, FontNames etc.

Note: This property is ignored if used inside template XML file.
By default no template is used. Optional
propertyTemplateFolder String. Path to directory with Editor's templates XML files. Default "ed_templates". Optional
propertyUpperSuggest Bool. Gets or sets a value indicating that suggestions of the spell checker should start with a letter in upper case.
Default false. Optional
propertyUrlBrowse String. Gets/sets the name of the predefined URL Links browser. Default "myUrlBrowse". Optional
propertyValidationGroup String. Name for the group of validation controls for which the control's submit causes validation when it posts back to the server.
This property has an effect only when the value of the CausesValidation property is set to true.

Default String.Empty . Optional
propertyWidth Int. Editor component width in pixels. Default value is set in style.css file in HC_div class height property (top of the CSS file). Initialy it is set 100%. Optional

"I would like to tip my hat to you on your response time...holy buckets, I have never had someone respond that fast. Thank You!!"

Bryan Spann

Random testimonial   All testimonials