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 |
| Text | Standard single-line text input |
| Email | Email input with HTML5 validation |
| Mobile | Mobile number input with masking |
| IP | IP address input with input mask |
| Password | Password input field |
| Currency | Numeric input with currency symbol |
| Numbers | Numeric-only input |
| MultiLine | Textarea for long text |
| Hidden | Hidden form field |
| File | File upload input |
| FileDisplay | Text field with file picker icon |
Properties
The TextBox25.Properties class controls rendering and behavior.
| Property |
Type |
Description |
| ControlId | string | Unique ID and name of the input |
| Label | string | Label text displayed above the input |
| Value | string | Initial value of the control |
| PlaceHolder | string | Placeholder text |
| IsRequired | bool | Marks field as required (*) |
| ReadOnly | bool | Makes input read-only |
| MaxLength | string | Maximum allowed characters |
| Rows | int | Rows for multiline textbox |
| Size | enum | Predefined width (S1–S5, Max, Auto) |
| CustomWidth | string | Overrides size in pixels |
| TextBoxType | enum | Type of textbox to render |
| AutoCompleteUrl | string | URL for autocomplete suggestions |
| IsPostback | bool | Submit form on autocomplete select |
Size Options
| Size |
Width |
| S1 | 50px |
| S2 | 100px |
| S3 | 150px |
| S4 | 200px |
| S5 | 250px |
| Max | 100% |
| Auto | auto |
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