LogoLogo
HomeNewsSupportVideos
  • Introduction
  • Getting Started
  • What's new in 4.0
    • Known Issues
    • .NET Core Designer
    • Managed Graphics
    • Fluent Markup
    • Markdown Support
    • Upgrade from 3.x
  • Releases
    • What's new in 4.0
    • What's new in 3.5
    • What's new in 3.2
      • View Builder
      • Validation Rules
      • Enhanced Font Support
      • Design-Time Debug
    • What's new in 3.1
    • What's new in 3.0
      • FAQs
      • Update Existing Projects
      • Multi Targeting
      • Visual Studio Designer
      • Referencing Assemblies
      • Docker Support
      • Troubleshooting
      • Deployment
    • What's new in 2.5
    • What's new in 2.2
    • What's new in 2.1
    • What's new in 2.0
    • Upgrade from 1.x
  • Getting Started
    • New Project
    • Templates
    • Troubleshooting
    • License Activation
    • FAQ
    • API
    • Hybrid
    • Deployment
    • Theme Builder
  • Concepts
    • Startup
    • Configuration
    • Load Balancing
    • Designer
    • Layouts
    • Client Profiles
    • Tab Order
    • Compression
    • Embedded Resources
    • Modal Workflow
    • Localization
    • RightToLeft
    • Background Tasks
    • Real Time Web Applications
    • JavaScript
    • JavaScript Object Model
    • Security
    • Synchronization
    • Session Management
    • Theming
    • Dependency Injection
    • Application Switches
    • Visual Studio Code
  • Controls & Components
    • General
      • Application
      • AutoSizing
      • AutoScroll
      • AutoScaling
      • Accessibility
      • Colors & Fonts
      • Embedded Tools
      • Events
      • Touch Events
      • Images
      • Labels
      • ToolTips
      • Data Binding
      • Common Properties
      • Custom Painting
      • Move & Resize
      • Drag & Drop
      • Validation
      • User Data
      • Responsive Properties
      • VB.NET Extensions
    • Common Dialogs
      • FolderBrowserDialog
      • ColorDialog
      • OpenFileDialog
      • SaveFileDialog
    • Editors
      • TextBox
        • TagTextBox
        • MaskedTextBox
        • TypedTextBox
      • DateTimePicker
      • MonthCalendar
      • TimeUpDown
      • DomainUpDown
      • NumericUpDown
      • TrackBar
    • Buttons
      • Button
      • SplitButton
      • CheckBox
      • RadioButton
    • Containers
      • Page
      • Form
      • Desktop
      • Panel
      • FlexLayoutPanel
      • FlowLayoutPanel
      • TableLayoutPanel
      • GroupBox
      • Accordion
      • TabControl
      • UserPopup
      • UserControl
      • ToolBar
      • StatusBar
      • SplitContainer
      • SlideBar
    • Lists & Grids
      • ComboBox
        • UserComboBox
        • TreeViewComboBox
        • ListViewComboBox
      • ListBox
        • CheckedListBox
      • TreeView
      • ListView
      • DataGridView
        • Column
        • TextBoxColumn
        • ButtonColumn
        • LinkColumn
        • ImageColumn
        • MaskedTextBoxColumn
        • DateTimePickerColumn
        • NumericUpDownColumn
        • CheckBoxColumn
        • ComboBoxColumn
      • DataRepeater
      • PropertyGrid
    • Extenders
      • Animation
      • ToolTip
      • ErrorProvider
      • Rotation
      • StyleSheet
      • JavaScript
    • Media
      • Audio
      • Video
      • FlashPlayer
    • Content
      • Label
      • LinkLabel
      • PictureBox
      • ScrollBars
      • Upload
      • AspNetPanel
      • ImageList
      • PdfViewer
      • ProgressBar
      • Spacer
      • Widget
      • WebBrowser
      • IFramePanel
      • HtmlPanel
      • Canvas
      • Shape
      • Line
    • Menus
      • MainMenu
      • MenuBar
      • MenuItem
      • LinkMenuItem
      • ContextMenu
    • Notifications
      • AlertBox
      • MessageBox
      • Toast
    • Other Components
      • Timer
      • BindingSource
      • BindingNavigator
      • DataSet
      • EventLog
      • MessageQueue
      • PerformanceCounter
Powered by GitBook
On this page
  • Features
  • Label
  • Data Binding
  • Spell Checking
  • Tool Buttons
  • Lazy Events
  • Watermark
  • Password
  • Character Casing
  • How To
  • Enter tab or enter
  • Filter keyboard input
  • Customize the appearance
  • Native Input Types
  • Advanced
  • AutoComplete
  • Select content when focused
  • Native context menu
  • JavaScript Widget

Was this helpful?

Export as PDF
  1. Controls & Components
  2. Editors

TextBox

Represents an <input> element that can be used to edit unformatted text.

PreviousEditorsNextTagTextBox

Last updated 3 months ago

Was this helpful?

The Wisej.Web.TextBox control enables users to enter unformatted text.

The TextBox control accepts a single line of text. Enable the Multiline property to allow multiple lines of text input.

For a full list of properties, methods and events see the API documentation.

Features

Label

The TextBox control supports the inline Label property. This allows setting a label in relation to a TextBox control without creating an additional Label control.

Labels

Data Binding

Data binding supports formatting and value conversion through the default data binding infrastructure. The default data property is Text.

Data Binding

Spell Checking

Enable the browser's built-in spell checking by setting the SpellCheck property to true.

This functionality relies on the browser's language and spell checking support. Third-party spell checking is possible but outside Wisej.NET functionality.

Tool Buttons

A key Wisej.NET feature available in most controls. The Tools property enables adding internal buttons aligned left or right, with user clicks handled through the ToolClicked event.

Embedded Tools

Lazy Events

Some TextBox events fire only when a handler is attached. This prevents unnecessary browser requests unless explicitly subscribed.

The KeyDown event is a Lazy Event, preventing ajax requests for each character typed.

When extending a control class and overriding On[EventName] for a lazy event without attaching a handler, the code won't execute unless a handler is attached.

Events

Watermark

All Wisej.NET editable controls include the Watermark property, displaying background text in empty fields.

Wisej.NET renders the watermark using the placeholder HTML attribute when supported, otherwise creating an overlaid label managed by the Wisej.NET JavaScript library.

Password

Set the PasswordChar property to any character or the InputType to Password for a password input field. The PasswordChar value always converts to "*" as browsers control password field display. This property exists for WinForms migration compatibility.

For a password visibility toggle, add a tool icon and switch InputType between Text and Password.

Character Casing

The CharacterCasing property forces text case transformation on both client and server. Wisej.NET performs the change while typing (client) and when setting the Text property (server).

How To

Enter tab or enter

By default, Tab moves focus to the next control and Enter does nothing. For tab characters and newlines, set Multiline to true and enable AcceptsTab or AcceptsReturn.

Filter keyboard input

Limit accepted characters using either:

  1. Set the Filter property to a regular expression

  2. Handle the keydown event on the client with JavaScript

Server-side KeyDown handling cannot prevent character input as the browser processes it before server communication.

Customize the appearance

Customize TextBox appearance through:

  1. Properties (BackColor, ForeColor, BorderStyle, Font)

  2. Custom theme

  3. Theme mixin

  4. Custom styles

For specialized UI like Material-3 animated underline on focus, use theme customization or custom styles.

The image shows a TextBox with "border-radius:20px" in CssStyle. For shared styles, use CssClass and add a StyleSheet file through Default.html or the StyleSheet extender.

Native Input Types

The TextBox supports various <input> types through the InputType property.

Native input styling is limited to browser-specific CSS properties outside the Wisej.NET theme system.

The Text property always returns a string representing the native input value. Special input types have specific behaviors:

Radio

Clicking toggles the Checked property and fires CheckedChanged (not TextChanged). Checked value is "on".

Browsers don't fire events for <input type=radio>. Content localization depends on browser language.

Checkbox

Clicking toggles the Checked property and fires CheckedChanged (not TextChanged). Checked value is "on".

Advanced

AutoComplete

The AutoCompleteList property enables browser native autocomplete with a string array.

Browser filters the AutoCompleteList as users type.

The AutoComplete property controls this feature. When enabled, browsers may build their own suggestions.

Common AutoComplete options include:

Option
Description

Email

An email address

Username

A username or account name

NewPassword

A new password field for account creation or password changes

CurrentPassword

The user's current password

OneTimeCode

A one-time verification code

See Mozilla Developer Site for all options.

Browser implementation controls this functionality, including when to use previous values.

Select content when focused

Wisej.NET selects all text when tabbing between fields. Clicking places the cursor at click location.

Enable SelectOnEnter for automatic text selection on any focus method.

Native context menu

EnableNativeContextMenu (default: true) controls the browser's context menu on right-click. Disable to prevent the native menu.

An assigned ContextMenu always overrides the native menu.

JavaScript Widget

Item
Description

Class name

"wisej.web.TextBox" or "wisej.web.TextArea" when Multiline is true

Theme appearance

"textbox", see Themes

Child components

"textfield" is the inner <input> widget. See JavaScript

Toolcontainer state

"editor", see Embedded Tools

Source code

https://github.com/iceteagroup/wisej-js

TextBox with label
TextBox with spell checking enabled
TextBox with tool buttons
TextBox with watermark
Equivalent to setting Filter = "[a-zA-Z]"
TextBox with custom border radius
Native input types in Chrome
TextBox with autocomplete list
TextBox showing filtered autocomplete options