CS4 webControl25

CS4 webControl25

TextBox25

TextBox25 is a flexible input control used to render different types of text-based form fields such as text, email, mobile, password, numbers, currency, multiline text, file upload, and autocomplete-enabled inputs.

Features

  • Supports multiple input types using a single control
  • Built-in label and required field handling
  • Predefined size options with custom width support
  • Autocomplete support with optional postback
  • File upload and file display variants
  • Bootstrap-compatible markup

Supported TextBox Types

TextBoxType Description
TextStandard single-line text input
EmailEmail input with HTML5 validation
MobileMobile number input with masking
IPIP address input with input mask
PasswordPassword input field
CurrencyNumeric input with currency symbol
NumbersNumeric-only input
MultiLineTextarea for long text
HiddenHidden form field
FileFile upload input
FileDisplayText field with file picker icon

Properties

The TextBox25.Properties class controls rendering and behavior.

Property Type Description
ControlIdstringUnique ID and name of the input
LabelstringLabel text displayed above the input
ValuestringInitial value of the control
PlaceHolderstringPlaceholder text
IsRequiredboolMarks field as required (*)
ReadOnlyboolMakes input read-only
MaxLengthstringMaximum allowed characters
RowsintRows for multiline textbox
SizeenumPredefined width (S1–S5, Max, Auto)
CustomWidthstringOverrides size in pixels
TextBoxTypeenumType of textbox to render
AutoCompleteUrlstringURL for autocomplete suggestions
IsPostbackboolSubmit form on autocomplete select

Size Options

Size Width
S150px
S2100px
S3150px
S4200px
S5250px
Max100%
Autoauto

Rendering the Control

Using Properties Object

var txt = new TextBox25.Properties { ControlId = "UserName", Label = "User Name", PlaceHolder = "Enter user name", IsRequired = true, TextBoxType = TextBox25.TextBoxType.Text, Size = TextBox25.Size.Max }; @TextBox25.GetHtml(txt)

Direct Method Call

@TextBox25.GetHtml( "Email", TextBox25.Size.S4, TextBox25.TextBoxType.Email, "", "Email Address", "Enter email", false, true )

Autocomplete Support

If AutoCompleteUrl is provided, the control automatically injects JavaScript and binds autocomplete behavior to the textbox.

AutoCompleteUrl = "/api/search/users", IsPostback = false
When IsPostback is set to false, the form will not submit automatically on selection.

File and FileDisplay Types

File

  • Standard file input
  • Uses Bootstrap custom file styles

FileDisplay

  • Text input with paperclip icon
  • Hidden file input triggered via icon click
  • Displays selected file name