A newer version of this page is available. Switch to the current version.

ASPxTextBox Class

A text box editor.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll


public class ASPxTextBox :

The following members accept/return ASPxTextBox objects:


The ASPxTextBox control allows end users to enter text in a single line.


Create a Text Box

Design Time

The ASPxTextBox control is available on the DX.19.1: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize control settings, or paste the control markup in the page’s source code.

<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Text="Test text" Width="170px">

Run Time

using DevExpress.Web;
protected void Page_Load(object sender, EventArgs e)
ASPxTextBox textBox = new ASPxTextBox();
textBox.ID = "ASPxTextBox1";
textBox.Width = Unit.Pixel(170);
textBox.Text = "Test text";

Client-Side API

The ASPxTextBox‘s client-side API is implemented with JavaScript language and exposed by the ASPxClientTextBox object.


Available by default.

Class name


Access name





Data-Bound Mode

You can bind the text box control to data fields in a data source.

<dx:ASPxTextBox ID="ASPxTextBox" runat="server" Width="100%" Value='<%# Bind("Name") %>' >

More details | See demo

Native Render

Set the Native property to true to render the ASPxTextBox as a native HTML text input element. This reduces the amount of generated HTML code and improves the editor’s performance. In native mode, the text box’s appearance depends on how the client browser renders native HTML elements.

<dx:ASPxTextBox ID="TextBox" runat="server" Native="True" Width="166" Text="TextBox">

Native Mode | See demo

Null Prompt Text

The text box displays a prompt text if its value is null and if the editor is not focused. The prompt text disappears when the editor receives focus. Use the NullText property to define the prompt text.

<dx:ASPxTextBox ID="TextBox" runat="server" NullText="Enter your name..." Width="166" Text="TextBox">

See demo

Masked Input

The text box editor allows you to use masks (MaskSettings when you edit the editor. Use masks to specify format to enter a value to the editor.

<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="100%" Caption="Zip Code">
    <MaskSettings Mask="00000" ErrorText="Please input missing digits" />

Learn more | See demo