Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q2 2011 released 07/12/2011
select

Input / First Look

Example Configuration
Select Mask:
select
Selection On Focus:
select
Show/Hide Label Enable Prompt Char
Display Mask Display Prompt Char


Multiline Input: 

  • Use the configurator to alter the settings of the Single-line RadMaskedTextBox. You can change its Mask, SelecttionOnFocus enable/disable its DisplayMask, DisplayPromptChar, PromtChar properties.
    The second input illustrates a Multi-line RadMaskedTextBox.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="false" Inherits="Telerik.InputExamplesCS.RadMaskedTextBox.FirstLook.DefaultCS" %>

    <%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <qsf:HeadTag runat="server" ID="Headtag1"></qsf:HeadTag>
        <!-- custom head section -->
        <!-- end of custom head section -->
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
        <qsf:Header runat="server" ID="Header1" NavigationLanguage="C#" AccessibilityLevel="AAA">
        </qsf:Header>
        <!-- content start -->
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <qsf:ConfiguratorPanel ID="ConfiguratorPanel" runat="server" Expanded="true">
            <telerik:RadFormDecorator ID="RadFormDecorator" runat="server" />
            <table>
                <tr>
                    <td style="width: 250px">
                        Select Mask:
                        <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Text="IP address" Selected="True" />
                                <telerik:RadComboBoxItem Text="Credit Card number" />
                                <telerik:RadComboBoxItem Text="Telephone" />
                                <telerik:RadComboBoxItem Text="SSN" />
                                <telerik:RadComboBoxItem Text="Custom" />
                            </Items>
                        </telerik:RadComboBox>
                    </td>
                    <td>
                        Selection On Focus:
                        <telerik:RadComboBox ID="RadComboBox2" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadComboBox2_SelectedIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Value="None" />
                                <telerik:RadComboBoxItem Text="SelectAll" Value="SelectAll" Selected="true" />
                                <telerik:RadComboBoxItem Text="CaretToBeginning" Value="CaretToBeginning" />
                                <telerik:RadComboBoxItem Text="CaretToEnd" Value="CaretToEnd" />
                            </Items>
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadButton ID="RadButton1" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            Text="Show/Hide Label" Checked="true" AutoPostBack="true" OnCheckedChanged="RadButton1_CheckedChanged">
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton2" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            Text="Enable Prompt Char" Checked="true" AutoPostBack="true" OnCheckedChanged="RadButton2_CheckedChanged">
                        </telerik:RadButton>
                    </td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadButton ID="RadButton3" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            Text="Display Mask" Checked="false" AutoPostBack="true" OnCheckedChanged="RadButton3_CheckedChanged">
                        </telerik:RadButton>
                    </td>
                    <td>
                        <telerik:RadButton ID="RadButton4" runat="server" ButtonType="ToggleButton" ToggleType="CheckBox"
                            Text="Display Prompt Char" Checked="false" AutoPostBack="true" OnCheckedChanged="RadButton4_CheckedChanged">
                        </telerik:RadButton>
                    </td>
                </tr>
            </table>
        </qsf:ConfiguratorPanel>
        <telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" SelectionOnFocus="SelectAll"
            Label="IP address: " PromptChar="_" Width="300px" Mask="<0..255>.<0..255>.<0..255>.<0..255>">
        </telerik:RadMaskedTextBox><br />
        <br />
        Multiline Input:&nbsp;<telerik:RadMaskedTextBox Width="210px" Height="80px" ID="RadMaskedTextBox2"
            runat="server" Mask="Te\lephone: (###) ###-####-####\r\nF\ax: (###) ###-####-####\r\nZip code: #####-####"
            TextMode="MultiLine" Rows="5" Columns="50">
        </telerik:RadMaskedTextBox>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadMaskedTextBox1" />
                        <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadComboBox2">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadMaskedTextBox1" />
                        <telerik:AjaxUpdatedControl ControlID="RadComboBox2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButton1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadMaskedTextBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButton2">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadMaskedTextBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButton3">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadMaskedTextBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButton4">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadMaskedTextBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <!-- content end -->
        <qsf:Footer runat="server" ID="Footer1"></qsf:Footer>
        </form>
    </body>
    </html>

Get more than expected!

 
 

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2024 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451