SAIFTextBox¶
SAIFTextBox is a TextBox subclass that adds a client-side character counter for multi-line text boxes with a configured MaxLength, rendering an additional message panel beneath the text box that the associated TextBox.js script updates as the user types.
Purpose¶
- Give multi-line text boxes with a character limit a visible remaining-character counter, without requiring host pages to build the counter UI themselves.
Context¶
- Namespace:
SAIF.Presentation.Web.Controls.V2 - Assembly/package: Compiled into
SAIF.BOF.Presentation.Web.Infragistics103*
Public members¶
| Member | Signature | Purpose |
|---|---|---|
ShowCharacterCounter |
Public Property ShowCharacterCounter As Boolean |
Enables the rendered character-counter panel for multi-line boxes with MaxLength > 0; defaults to True. |
RenderControl(writer) |
Public Overrides Sub RenderControl(ByVal writer As HtmlTextWriter) |
Adds a SaifMaxLength HTML attribute (read by TextBox.js) and, when applicable, renders the counter panel after the base text box markup. |
CreateChildControls() |
Protected Overrides Sub CreateChildControls() |
Creates the counter message Panel child control when the box is multi-line, has a MaxLength, and ShowCharacterCounter is enabled. |
Inherited public members¶
SAIFTextBox inherits from TextBox (System.Web.UI.WebControls), a framework base class rather than a documented SAIF dependency library.
| Member | Signature | Purpose |
|---|---|---|
AutoCompleteType |
Public Property AutoCompleteType As AutoCompleteType |
Hints browser autocomplete behavior for the text input. |
AutoPostBack |
Public Property AutoPostBack As Boolean |
Determines whether text changes immediately post the page back when supported by the rendered mode. |
Columns |
Public Property Columns As Integer |
Visible character width of the rendered text box. |
MaxLength |
Public Property MaxLength As Integer |
Maximum number of characters accepted by the control. |
ReadOnly |
Public Property ReadOnly As Boolean |
Prevents user edits while still rendering the text value. |
Rows |
Public Property Rows As Integer |
Visible row count when the text box is multi-line. |
Text |
Public Property Text As String |
Current text content edited or displayed by the control. |
TextMode |
Public Property TextMode As TextBoxMode |
Selects single-line, multi-line, password, and other input rendering modes. |
Wrap |
Public Property Wrap As Boolean |
Controls line wrapping behavior for multi-line text boxes. |
TextChanged |
Public Event TextChanged As EventHandler |
Standard text-change event raised after postback. |
Standard TextBox/Control members (ID, ClientID, Controls, Visible, DataBind, FindControl, etc.) are not re-documented here as they are unmodified framework behavior**.
Behavioral notes¶
- Only applies the character-counter behavior when
TextMode = TextBoxMode.MultiLineandMaxLength > 0; single-line boxes and boxes without aMaxLengthrender unchanged. RegisterClientScriptsregistersTextBox.jsonInit, which is expected to read theSaifMaxLengthattribute and update the counter panel client-side.
Constraints and usage notes¶
- Requires
TextBox.jsto be deployed at/Resources/Scripts/Controls/TextBox.jsfor the live counter update to function; its detailed logic could not be verified from this library's source**.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
- SAIF.Presentation.Web.Controls.V2\SAIFTextBox.vb