TX Text Control .NET Server

TextControl Class

Class|Introduced in 21.0
Namespace
TXTextControl.Web
Package
None: the TX Text Control .NET Server setup installs it, for .NET Framework.
Assembly
TXTextControl.Web.dll
Inherits
  1. WebControl
  2. TextControl

Description

The TextControl class implements a control with high-level text editing features. It is inherited from the System.Web.UI.WebControls.WebControl class. The following describes only the properties, methods and events defined through the TextControl class. For a list of properties, methods and events inherited from the System.Web.UI.WebControls.WebControl class see the .NET Framework reference.

Syntax

public class TextControl : WebControl

Examples

The following example creates a Text Control object and prepares it for a document workflow.

TXTextControl.Web.MVC.TextControl textControl = new();
Console.WriteLine("Text Control is ready for the document workflow.");

Members

Constructors

ConstructorDescription
TextControlInitializes a new instance of the TextControl class.

Properties

PropertyDescription
BackColorSpecifies or returns the background color of the main text area and the ruler bars.
ContextMenusEnabledSpecifies or returns a value indicating if a right click opens a context menu or not.
ControlCharsSpecifies if control characters are visible or not.
CultureGets or sets the control's culture. Affects date and time string formats, for example.
DockGets or sets a value how the control is docked to its container or web site.
DocumentTargetMarkersSpecifies or returns a value indicating if markers for hypertext targets are shown in the editor or not.
EditModeSpecifies or returns a value of type Web.EditMode indicating whether the document's text is read-only, can be selected or is editable.
FormattingPrinterGets or sets the name of a printer the text dimensions and capabilities of which are used to format the document. If the document is printed with this printer the displayed and the printed document have the same dimensions. If the property is set to Standard, the system installed standard printer is used to format the document. If the property is set to Display, the font dimensions of the display device are used to format the document. If the specified printer is not installed, the standard printer is used.
IsReadyGets a value indicating whether all TX Text Control components are completely loaded in the service's worker process.
SaveDocumentQuestionDialogEnabledSpecifies or returns a value indicating if a confirmation dialog should be shown before discarding unsaved changes.
SelectionGets or sets the current selection in the text part with the input focus. The property value is an object of the type Web.Selection.
ServiceAddressGets or sets the IP address at which the websocket handler tries to connect to the Service. The default value is 127.0.0.1 (the local computer). Important: setting this property affects all instances of class Web.TextControl. It was not made static so it shows up in the Visual Studio designer.
ServicePortGets or sets the Port at which the websocket handler tries to connect to the Service. Important: setting this property affects all instances of class Web.TextControl. It was not made static so it shows up in the Visual Studio designer.
StatusBarColorSpecifies or returns the background color of the status bar.
TableGridLinesSpecifies or returns a value indicating wether table grid lines are shown in the editor or not.
TextFieldsEditableGets or sets if text fields are editable or not.
TextFrameMarkerLinesSpecifies whether text frames that have no border line are shown with marker lines.
TextPartsGets a collection of all text parts the current document contains. The property's value is an object of the type Web.TextPartCollection. A text part can be the main text, a text frame or a header or footer.
UICultureGets or sets the control's user interface culture. Affects the string resource language.
UserNamesGets or sets a list of names specifying users who have access to editable regions. When a document is set to read-only all editable regions that are related to these users can be edited.
WebSocketHandlerPathSpecifies the path to the WebSocket handler (TXWebSocketHandler.ashx). If set to null (the default value) or an empty string, the browser derives the WebSocket handler URL from the current page's URL. This property sets the portion of the path BETWEEN the web site root and the handler-ashx-file (e. g. "/foo/bar/" in case of the handler listening at ws://www.website.com/foo/bar/TXWebSocketHandler.ashx). In most cases this property doesn't need to be set and the browser generated URL works fine. However, if the web control is used in an ASP.Net MVC application and the web page containing the editor resides in a virtual directory, the WebSocket handler URL generated by the browser will be invalid. This makes it impossible for the web app to connect to the web server. Use this property to correct the WebSocket handler URL in that case. Absolute (e. g. "/editor/") and relative directories (e. g. "../../") are possible.

Methods

MethodDescription
GetFileDirectoryReturns the directory path where the files of a specific file type are stored.
GetFileDirectoryAsyncReturns the directory path where the files of a specific file type are stored.
LoadDataFromJsonUses data given as a JSON string as a data source. The JSON string has to contain an array of equally structured objects. Analyzes and uses the given objects as merge data in the same way as the method LoadDataFromModel.
LoadDataFromJsonAsyncUses data given as a JSON string as a data source. The JSON string has to contain an array of equally structured objects. Analyzes and uses the given objects as merge data in the same way as the method LoadDataFromModel. The method returns immediately.
LoadDataFromModelLoads a collection implementing interface System.Collections.IEnumerable as a data source.
LoadDataFromModelAsyncLoads a collection implementing interface System.Collections.IEnumerable as a data source.
LoadDataSetLoads a database which is used to create table and field name menu items in the mailings ribbon tab from an existing DataSet object.
LoadDataSetAsyncLoads a database which is used to create table and field name menu items in the mailings ribbon tab from an existing DataSet object. This method returns immediately and does not wait for the DataSet to be loaded completely.
LoadTextLoads text in a certain format. The complete contents of a TextControl are replaced.
LoadTextAsyncLoads text in a certain format. The complete contents of a Text Control are replaced. This method returns immediately and does not wait for the text to be completely loaded.
LoadXMLDatabaseLoads an XML database which is used to create table and field name menu items in the mailings ribbon tab.
LoadXMLDatabaseAsyncLoads an XML database which is used to create table and field name menu items in the mailings ribbon tab. The method returns immediately and does not wait for the database to be completely loaded.
ResetContentsDeletes the entire contents of the control.
SaveTextSaves the complete contents of a document with the specified format.
SetFileDirectoryDetermines the directory path where the files of a specific file type are stored.
SetFileDirectoryAsyncDetermines the directory path where the files of a specific file type are stored.

Further Reading

  • Sneak Peek X15: Custom Field Overlays in HTML5-based Text Control –
  • Web.TextControl: Adaptive Merge Field Drop-down Lists –
  • TX Text Control X14 Service Pack 1 Deployed to ReportingCloud Portal and API –
  • Web.TextControl: JQueryUI Alert Boxes and Javascript Events –