New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

The RadInputControl control is the base for all Telrik RadInput controls. RadNumericTextBox, RadMaskedTextBox, RadDateInput, RadTextBox, RadInputManager

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[EmbeddedSkin("Input", typeof(RadInputControl))]
[EmbeddedSkin("Input", "Default", typeof(RadInputControl))]
[RequiredScript(typeof(Core))]
[RequiredScript(typeof(MaterialRipple))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadInputControl))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadInputControl))]
public abstract class RadInputControl : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IPostBackEventHandler, INamingContainer, IEditableTextControl, ITextControl

Inheritance: objectControlWebControlRadWebControlRadInputControl

Derived Classes: RadDateInputRadMaskedTextBoxRadNumericTextBoxRadTextBox

Implements: IAttributeAccessorIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlResolverIDataBindingsAccessorIDisposableIEditableTextControlIExpressionsAccessorINamingContainerIParserAccessorIPostBackDataHandlerIPostBackEventHandlerIScriptControlISkinnableControlITextControlIUrlResolutionService...

Inherited Members WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.MergeStyle(Style)WebControl.Render(HtmlTextWriter)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.AttributesWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.DisabledCssClassWebControl.StyleWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.IsEnabledWebControl.SupportsDisabledAttributeControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind()Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.OnInit(EventArgs)Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.LoadControlState(object)Control.MapPathSecure(string)Control.OpenFile(string)Control.OnLoad(EventArgs)Control.OnPreRender(EventArgs)Control.BuildProfileTree(string, bool)Control.SaveControlState()Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadInputControl()

Fields

C#
protected Unit setHeight
C#
protected string setStyle
C#
protected Unit setWidth

Properties

Gets or sets the access key that allows you to quickly navigate to the Web server control.

C#
public override string AccessKey { get; set; }
Property Value:

The access key for quick navigation to the Web server control. The default value is Empty, which indicates that this property is not set.

Exceptions: ArgumentOutOfRangeException

The specified access key is neither null, Empty nor a single character string.

Overrides: RadWebControl.AccessKey

Gets or sets a value that indicates the AutoComplete behavior of the input control

C#
[Themeable(false)]
public virtual AutoCompleteType AutoCompleteType { get; set; }
Property Value:

One of the System.Web.UI.WebControls.AutoCompleteType enumeration values, indicating the AutoComplete behavior for the input control. The default value is None.

Exceptions: ArgumentOutOfRangeException

The selected value is not one of the System.Web.UI.WebControls.AutoCompleteType enumeration values.

To assist with data entry, Microsoft Internet Explorer 5 and later and Netscape support a feature called AutoComplete. AutoComplete monitors a RadInput control and creates a list of values entered by the user. When the user returns to the input at a later time, the list is displayed. Instead of retyping a previously entered value, the user can simply select the value from this list. Use the AutoCompleteType property to control the behavior of the AutoComplete feature for a RadInput control. The System.Web.UI.WebControls.AutoCompleteType enumeration is used to represent the values that you can apply to the AutoCompleteType property. Not all browsers support the AutoComplete feature. Check with your browser to determine compatibility.

By default, the AutoCompleteType property for a RadInput control is set to AutoCompleteType.None. With this setting, the RadInput control shares the list with other RadInput controls with the same ID property across different pages. You can also share a list between RadInput controls based on a category, instead of an ID property. When you set the AutoCompleteType property to one of the category values (such as AutoCompleteType.FirstName, AutoCompleteType.LastName, and so on), all RadInput controls with the same category share the same list. You can disable the AutoComplete feature for a RadInput control by setting the AutoCompleteType property to AutoCompleteType.Disabled.

Refer to your browser documentation for details on configuring and enabling the AutoComplete feature. For example, to enable the AutoComplete feature in Internet Explorer version 5 or later, select Internet Options from the Tools menu, and then select the Content tab. Click the AutoComplete button to view and modify the various browser options for the AutoComplete feature.

This property cannot be set by themes or style sheet themes.

Example:
cs-api-definition
</%@ Page Language="C#" /%>


</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head id="Head1" runat="server">
<title>AutoCompleteType example</title>
</head>
<body>

<form id="form1" runat="server">
<!-- You need to enable the AutoComplete feature on -->

<!-- a browser that supports it (such as Internet   -->
<!-- Explorer 5.0 and later) for this sample to     -->

<!-- work. The AutoComplete lists are created after -->
<!-- the Submit button is clicked.                  -->

<h3>
AutoCompleteType example</h3>
Enter values in the text boxes and click the Submit
<br />

button.
<br />
<br />
<!-- The following TextBox controls have different  -->

<!-- categories assigned to their AutoCompleteType  -->
<!-- properties.                                    -->

First Name:<br />
<radI:RadTextBox ID="FirstNameTextBox" AutoCompleteType="FirstName" runat="server" />
<br />

Last Name:<br />
<radI:RadTextBox ID="LastNameTextBox" AutoCompleteType="LastName" runat="server" />
<br />

Email:<br />
<radI:RadTextBox ID="EmailTextBox" AutoCompleteType="Email" runat="server" />
<br />

<!-- The following TextBox controls have the same   -->
<!-- categories assigned to their AutoCompleteType  -->

<!-- properties. They share the same AutoComplete   -->
<!-- list.                                          -->
Phone Line #1:<br />

<radI:RadTextBox ID="Phone1TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />
Phone Line #2:<br />

<radI:RadTextBox ID="Phone2TextBox" AutoCompleteType="HomePhone" runat="server" />
<br />

<!-- The following TextBox control has its          -->
<!-- AutoCompleteType property set to               -->

<!-- AutoCompleteType.None. All TextBox controls    -->

<!-- with the same ID across different pages share  -->
<!-- the same AutoComplete list.                    -->
Category:<br />

<radI:RadTextBox ID="CategoryTextBox" AutoCompleteType="None" runat="server" />
<br />
<!-- The following TextBox control has the          -->

<!-- AutoComplete feature disabled.                 -->
Comments:<br />
<radI:RadTextBox ID="CommentsTextBox" AutoCompleteType="Disabled" runat="server" />

<br />
<br />
<br />
<asp:Button ID="SubmitButton" Text="Submit" runat="Server" />
</form>
</body>
</html>

Gets or sets a value indicating whether an automatic post back to the server occurs whenever the user presses the ENTER or the TAB key while in the RadInput control.

C#
[Themeable(false)]
[ClientControlProperty]
public virtual bool AutoPostBack { get; set; }
Property Value:

true if an automatic postback occurs whenever the user presses the ENTER or the TAB key while in the RadInput control; otherwise, false. The default is false.

Use the AutoPostBack property to specify whether an automatic post back to the server will occur whenever the user presses the ENTER or the TAB key while in the RadInput control.

Example:
cs-api-definition
</%@ Page Language="C#" AutoEventWireup="True" /%>
</%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>RadTextBox Example </title>


<script runat="server">


protected void Page_Load(Object sender, EventArgs e)
{
int Answer;


// Due to a timing issue with when page validation occurs, call the

// Validate method to ensure that the values on the page are valid.
Page.Validate();


// Add the values in the text boxes if the page is valid.
if(Page.IsValid)
{
Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text);


AnswerMessage.Text = Answer.ToString();
}


}
</script>


</head>
<body>
<form id="form1" runat="server">
<h3>
RadTextBox Example

</h3>
<table>
<tr>
<td colspan="5">
Enter integer values into the text boxes.

<br />
The two values are automatically added
<br />
when you tab out of the text boxes.

<br />
</td>
</tr>
<tr>
<td colspan="5">


</td>
</tr>
<tr align="center">
<td>

<radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" AutoPostBack="True" Text="1" runat="server" />
</td>
<td>

+
</td>
<td>
<radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" AutoPostBack="True" Text="1" runat="server" />

</td>
<td>
=
</td>
<td>
<asp:Label ID="AnswerMessage" runat="server" />

</td>
</tr>
<tr>
<td colspan="2">

<asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"
ErrorMessage="Please enter a value.<br />" EnableClientScript="False" Display="Dynamic"

runat="server" />
<asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"

MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"

EnableClientScript="False" Display="Dynamic" runat="server" />
</td>

<td colspan="2">
<asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"

ErrorMessage="Please enter a value.<br />" EnableClientScript="False" Display="Dynamic"
runat="server" />

<asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"
MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer <br /> between than 1 and 100.<br />"

EnableClientScript="False" Display="Dynamic" runat="server" />
</td>
<td>
&nbsp
</td>
</tr>
</table>

</form>
</body>
</html>

Gets or sets the background color of the Web server control.

C#
public override Color BackColor { get; set; }
Property Value:

A Color that represents the background color of the control. The default is Empty, which indicates that this property is not set.

Overrides: RadWebControl.BackColor

Gets or sets the border color of the Web control.

C#
public override Color BorderColor { get; set; }
Property Value:

A Color that represents the border color of the control. The default is Empty, which indicates that this property is not set.

Overrides: RadWebControl.BorderColor

Gets or sets the border style of the Web server control.

C#
public override BorderStyle BorderStyle { get; set; }
Property Value:

One of the BorderStyle enumeration values. The default is NotSet.

Overrides: RadWebControl.BorderStyle

Gets or sets the border width of the Web server control.

C#
public override Unit BorderWidth { get; set; }
Property Value:

A Unit that represents the border width of a Web server control. The default value is Empty, which indicates that this property is not set.

Exceptions: ArgumentException

The specified border width is a negative value.

Overrides: RadWebControl.BorderWidth

C#
protected HttpBrowserCapabilities Browser { get; }

Gets control that contains the buttons of RadInput control

C#
[Browsable(false)]
public virtual HtmlGenericControl ButtonContainer { get; }

The ShowButton or ShowSpinButton properties must be set to true

Gets or sets the CSS class applied to the RadInputControl button.

C#
public virtual string ButtonCssClass { get; set; }
Property Value:

The CSS class applied to the RadInputControl button.

Gets the wrapper control that holds all the buttons of RadInput control

C#
[Browsable(false)]
protected virtual HtmlGenericControl ButtonsLightContainer { get; }

The span container that holds the spin buttons and the default button

Gets or sets a value that indicates whether the button should be positioned left or right of the RadInput box.

C#
public virtual InputButtonsPosition ButtonsPosition { get; set; }

Gets or sets a value indicating whether validation is performed when the RadInput control is set to validate when a postback occurs.

C#
[Themeable(false)]
public virtual bool CausesValidation { get; set; }
Property Value:

true if validation is performed when the RadInput control is set to validate when a postback occurs; otherwise, false. The default value is false.

Use the CausesValidation property to determine whether validation is performed on both the client and the server when a RadInput control is set to validate when a postback occurs. Page validation determines whether the input controls associated with a validation control on the page all pass the validation rules specified by the validation control.

By default, a RadInput control does not cause page validation when the control loses focus. To set the RadInput control to validate when a postback occurs, set the CausesValidation property to true and the AutoPostBack property to true.

When the value of the CausesValidation property is set to true, you can also use the ValidationGroup property to specify the name of the validation group for which the RadInput control causes validation.

This property cannot be set by themes or style sheet themes.

Gets or sets an instance of the Telerik.WebControls.InputClientEvents class which defines the JavaScript functions (client-side event handlers) that are invoked when specific client-side events are raised.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputClientEvents ClientEvents { get; }

Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.

C#
public override string CssClass { get; set; }
Property Value:

The CSS class rendered by the Web server control on the client. The default is Empty.

Overrides: RadWebControl.CssClass

C#
protected virtual Unit defaultWidth { get; set; }

Gets the style properties for disabled RadInput control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputStyle DisabledStyle { get; }
Property Value:

A Telerik.WebControls.TextBoxStyle object that represents the style properties for disabled RadInput control. The default value is an empty TextBoxStyle object.

Use this property to provide a custom style for the disabled RadInput control. Common style attributes that can be adjusted include foreground color, background color, font, and alignment within the RadInput. Providing a different style enhances the appearance of the RadInput control.

Disabled style properties in the RadInput control are inherited from one style property to another through a hierarchy. For example, if you specify a red font for the EnabledStyle property, all other style properties in the RadInput control will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the DisabledStyle property, overriding the red font specified in the EnabledStyle property.

To specify a custom style, place the <DisabledStyle> tags between the opening and closing tags of the RadInput control. You can then list the style attributes within the opening <DisabledStyle> tag.

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server"&gt;

&lt;EnabledStyle BackColor="red" /&gt;
&lt;EmptyMessageStyle BackColor="AliceBlue" /&gt;

&lt;FocusedStyle BackColor="yellow" /&gt;
&lt;HoveredStyle BackColor="blue" /&gt;

&lt;/radI:RadTextBox&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Set to false in order to change "display" style of the wrapper span to "none"

C#
public bool Display { get; set; }

Gets or sets the display text which allows you to set the display value from the Server to a different value the actual value. Similar to the empty message, but shown even if the input is not empty. This text will be cleared once the user changes the input value.

C#
public virtual string DisplayText { get; set; }
Property Value:

The display text which allows you to set the display value from the Server to a different value the actual value. Similar to the empty message, but shown even if the input is not empty. This text will be cleared once the user changes the input value.

Gets or sets a value message shown when the control is empty.

C#
[Themeable(true)]
[ClientControlProperty]
public virtual string EmptyMessage { get; set; }
Property Value:

A string specifying the empty message. The default value is empty string. ("").

Shown when the control is empty and loses focus. You can set the empty message text through EmptyMessage property.

Example:
cs-api-definition
&lt;/%@ Page Language="C#" /%&gt;

&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;

&lt;title&gt;Untitled Page&lt;/title&gt;
&lt;script runat="server"&gt;

protected void Button1_Click(object sender, EventArgs e)
{

RadNumericTextBox1.EmptyMessage = RadNumericTextBox1.Text;
RadNumericTextBox1.Text = String.Empty;

}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox EmptyMessage="Type Here" ID="RadNumericTextBox1" runat="server"&gt;

&lt;/radI:RadTextBox&gt;

&lt;asp:Button ID="Button1" runat="server" Text="Set Empty Message" OnClick="Button1_Click" /&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Gets the style properties for RadInput when when the control is empty.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputStyle EmptyMessageStyle { get; }
Property Value:

A Telerik.WebControls.TextBoxStyle object that represents the style properties for RadInput control. The default value is an empty TextBoxStyle object.

Use this property to provide a custom style for the empty message state of RadInput control. Common style attributes that can be adjusted include foreground color, background color, font, and alignment within the RadInput. Providing a different style enhances the appearance of the RadInput control.

Empty message style properties in the RadInput control are inherited from one style property to another through a hierarchy. For example, if you specify a red font for the EnabledStyle property, all other style properties in the RadInput control will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the FocusedStyle property, overriding the red font specified in the EnabledStyle property.

To specify a custom style, place the <EmptyMessageStyle> tags between the opening and closing tags of the RadInput control. You can then list the style attributes within the opening <EmptyMessageStyle> tag.

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server"&gt;

&lt;EnabledStyle BackColor="red" /&gt;
&lt;EmptyMessageStyle BackColor="AliceBlue" /&gt;

&lt;FocusedStyle BackColor="yellow" /&gt;
&lt;HoveredStyle BackColor="blue" /&gt;

&lt;/radI:RadTextBox&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
C#
protected bool EmptySkin { get; }

Gets or sets the value, indicating whether to render the skin CSS files during Ajax requests

C#
public override bool EnableAjaxSkinRendering { get; set; }

Overrides: RadWebControl.EnableAjaxSkinRendering

If EnableAjaxSkinRendering is set to false you will have to register the needed control base CSS file by hand when adding/showing the control with Ajax.

When set to true enables support for WAI-ARIA

C#
[ClientPropertyName("enableAriaSupport")]
public bool EnableAriaSupport { get; set; }

Gets or sets a value indicating whether the Web server control is enabled.

C#
public override bool Enabled { get; set; }
Property Value:

true if control is enabled; otherwise, false. The default is true.

Overrides: RadWebControl.Enabled

Gets the style properties for enabled RadInput control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputStyle EnabledStyle { get; }
Property Value:

A Telerik.WebControls.TextBoxStyle object that represents the style properties for enabled RadInput control. The default value is an empty TextBoxStyle object.

Use this property to provide a custom style for the enabled RadInput control. Common style attributes that can be adjusted include foreground color, background color, font, and alignment within the RadInput. Providing a different style enhances the appearance of the RadInput control.

Enabled style properties in the RadInput control are inherited from one style property to another through a hierarchy. For example, if you specify a red font for the EnabledStyle property, all other style properties in the RadInput control will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the FocusedStyle property, overriding the red font specified in the EnabledStyle property.

To specify a custom style, place the <EnabledStyle> tags between the opening and closing tags of the RadInput control. You can then list the style attributes within the opening <EnabledStyle> tag.

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server"&gt;

&lt;EnabledStyle BackColor="red" /&gt;
&lt;EmptyMessageStyle BackColor="AliceBlue" /&gt;

&lt;FocusedStyle BackColor="yellow" /&gt;
&lt;HoveredStyle BackColor="blue" /&gt;

&lt;/radI:RadTextBox&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Gets or sets the value, indicating whether to render the link to the embedded base stylesheet of the control or not.

C#
public override bool EnableEmbeddedBaseStylesheet { get; set; }

Overrides: RadWebControl.EnableEmbeddedBaseStylesheet

If EnableEmbeddedBaseStylesheet is set to false you will have to register the needed control base CSS file by hand.

Gets or sets the value, indicating whether to render script references to the embedded scripts or not.

C#
public override bool EnableEmbeddedScripts { get; set; }

Overrides: RadWebControl.EnableEmbeddedScripts

If EnableEmbeddedScripts is set to false you will have to register the needed Scripts files by hand.

Gets or sets the value, indicating whether to render links to the embedded skins or not.

C#
public override bool EnableEmbeddedSkins { get; set; }

Overrides: RadWebControl.EnableEmbeddedSkins

If EnableEmbeddedSkins is set to false you will have to register the needed CSS files by hand.

Gets or sets whether the textbox width should include the textbox paddings and borders. The default value is FALSE, i.e. the textbox will actually be wider than expected.

C#
[ClientControlProperty]
public bool EnableOldBoxModel { get; set; }
Property Value:

Determines whether the textbox width should include the textbox paddings and borders. The default value is FALSE, i.e. the textbox will actually be wider than expected.

Gets or sets the single input rendering mode which renderes only two main HTML elements on the page, instead of two or three (depending on the specific RadInput) which are rendered in the non-single mode of the RadInputControl controls.

C#
public virtual bool EnableSingleInputRendering { get; set; }
Property Value:

The single input rendering mode which renderes only two main HTML elements on the page, instead of two or three (depending on the specific RadInput) which are rendered in the non-single mode of the RadInputControl controls.

Gets or sets a value indicating whether themes apply to this control.

C#
public override bool EnableTheming { get; set; }
Property Value:

true to use themes; otherwise, false. The default is false.

Overrides: RadWebControl.EnableTheming

Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

C#
public override bool EnableViewState { get; set; }
Property Value:

true if the server control maintains its view state; otherwise false. The default is true.

Overrides: Control.EnableViewState

Gets the style properties for focused RadInput control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputStyle FocusedStyle { get; }
Property Value:

A Telerik.WebControls.TextBoxStyle object that represents the style properties for focused RadInput control. The default value is an empty TextBoxStyle object.

Use this property to provide a custom style for the focused RadInput control. Common style attributes that can be adjusted include foreground color, background color, font, and alignment within the RadInput. Providing a different style enhances the appearance of the RadInput control.

Focused style properties in the RadInput control are inherited from one style property to another through a hierarchy. For example, if you specify a red font for the EnabledStyle property, all other style properties in the RadInput control will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the FocusedStyle property, overriding the red font specified in the EnabledStyle property.

To specify a custom style, place the <FocusedStyle> tags between the opening and closing tags of the RadInput control. You can then list the style attributes within the opening <FocusedStyle> tag.

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;

&lt;title&gt;Untitled Page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server"&gt;

&lt;EnabledStyle BackColor="red" /&gt;
&lt;EmptyMessageStyle BackColor="AliceBlue" /&gt;

&lt;FocusedStyle BackColor="yellow" /&gt;
&lt;HoveredStyle BackColor="blue" /&gt;

&lt;/radI:RadTextBox&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Gets or sets the height of the Web server control.

C#
public override Unit Height { get; set; }
Property Value:

A Unit that represents the height of the control. The default is Empty.

Exceptions: ArgumentException

The height was set to a negative value.

Overrides: RadWebControl.Height

Gets the style properties for hovered RadInput control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputStyle HoveredStyle { get; }
Property Value:

A Telerik.WebControls.TextBoxStyle object that represents the style properties for hovered RadInput control. The default value is an empty TextBoxStyle object.

Use this property to provide a custom style for the hovered RadInput control. Common style attributes that can be adjusted include foreground color, background color, font, and alignment within the RadInput. Providing a different style enhances the appearance of the RadInput control.

Hovered style properties in the RadInput control are inherited from one style property to another through a hierarchy. For example, if you specify a red font for the EnabledStyle property, all other style properties in the RadInput control will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the HoveredStyle property, overriding the red font specified in the EnabledStyle property.

To specify a custom style, place the <HoveredStyle> tags between the opening and closing tags of the RadInput control. You can then list the style attributes within the opening <HoveredStyle> tag.

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;

&lt;title&gt;Untitled Page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server"&gt;

&lt;EnabledStyle BackColor="red" /&gt;
&lt;EmptyMessageStyle BackColor="AliceBlue" /&gt;

&lt;FocusedStyle BackColor="yellow" /&gt;
&lt;HoveredStyle BackColor="blue" /&gt;

&lt;/radI:RadTextBox&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Set to true if you like the input to be rendered in invalid state.

C#
public bool Invalid { get; set; }

Gets the style properties for invalid state of RadInput control.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputStyle InvalidStyle { get; }
Property Value:

A Telerik.WebControls.TextBoxStyle object that represents the style properties for invalid RadInput control. The default value is an empty TextBoxStyle object.

Use this property to provide a custom style for the invalid state RadInput control. Common style attributes that can be adjusted include foreground color, background color, font, and alignment within the RadInput. Providing a different style enhances the appearance of the RadInput control.

Enabled style properties in the RadInput control are inherited from one style property to another through a hierarchy. For example, if you specify a red font for the EnabledStyle property, all other style properties in the RadInput control will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the InvalidStyle property, overriding the red font specified in the EnabledStyle property.

To specify a custom style, place the <InvalidStyle> tags between the opening and closing tags of the RadInput control. You can then list the style attributes within the opening <InvalidStyle> tag.

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox EmptyMessage="EmptyMessage" ID="RadNumericTextBox1" runat="server"&gt;

&lt;EnabledStyle BackColor="red" /&gt;
&lt;EmptyMessageStyle BackColor="AliceBlue" /&gt;

&lt;FocusedStyle BackColor="yellow" /&gt;
&lt;HoveredStyle BackColor="blue" /&gt;
&lt;/radI:RadTextBox&gt;

&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

The InvalidStyleDuration property is used to determine how long (in milliseconds) the control will display its invalid style when incorrect data is entered.

C#
[Themeable(true)]
[ClientControlProperty]
public virtual int InvalidStyleDuration { get; set; }

Gets or sets the text of the

C#
[Themeable(true)]
public virtual string Label { get; set; }
Property Value:

A string used as a label for the control. The default value is empty string ("").

If the value of this property has not been set, a tag will not be rendered. Keep in mind that accessibility standards require labels for all input controls.

Example:
C#
&lt;/%@ Page Language="C#" AutoEventWireup="True" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;


&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html&gt;

&lt;head&gt;

&lt;title&gt;RadTextBox Example &lt;/title&gt;


&lt;script runat="server"&gt;




protected void RadTextBox1_TextChanged(object sender, EventArgs e)

{
this.RadTextBox1.Label = this.RadTextBox1.Text;
}
&lt;/script&gt;


&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;h3&gt;

RadTextBox Example
&lt;/h3&gt;

&lt;radI:RadTextBox ID="RadTextBox1" AutoPostBack="true" EmptyMessage="Type Here" Label="Default Label: " runat="server" OnTextChanged="RadTextBox1_TextChanged"&gt;

&lt;/radI:RadTextBox&gt;


&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Gets or sets the CSS class applied to the tag rendered along with RadInput control.

C#
[Themeable(true)]
public virtual string LabelCssClass { get; set; }
Property Value:

A string used specifying the CSS class of the label of the control. The default value is empty string ("").

This property is applicable only if the Label property has been set.

Gets or sets width of the Label

C#
public Unit LabelWidth { get; set; }
C#
protected string LastSetTextBoxValue { get; set; }

Gets or sets the maximum number of characters allowed in the text box.

C#
public virtual int MaxLength { get; set; }
Property Value:

The maximum number of characters allowed in the text box. The default is 0, which indicates that the property is not set.

Use the MaxLength property to limit the number of characters that can be entered in the RadInput control. This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and Introduction to ASP.NET Themes.

Example:
cs-api-definition
&lt;/%@ Page Language="C#" AutoEventWireup="True" /%&gt;

&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html&gt;
&lt;head&gt;

&lt;title&gt;RadTextBox Example &lt;/title&gt;


&lt;script runat="server"&gt;


protected void AddButton_Click(Object sender, EventArgs e)
{

int Answer;


Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text);


AnswerMessage.Text = Answer.ToString();


}


&lt;/script&gt;


&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;

&lt;h3&gt;
RadTextBox Example
&lt;/h3&gt;
&lt;table&gt;

&lt;tr&gt;
&lt;td colspan="5"&gt;
Enter integer values into the text boxes.

&lt;br /&gt;
Click the Add button to add the two values.

&lt;br /&gt;
Click the Reset button to reset the text boxes.

&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="5"&gt;



&lt;/td&gt;
&lt;/tr&gt;
&lt;tr align="center"&gt;

&lt;td&gt;

&lt;radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" /&gt;

&lt;/td&gt;
&lt;td&gt;
+
&lt;/td&gt;

&lt;td&gt;
&lt;radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" /&gt;

&lt;/td&gt;
&lt;td&gt;
=
&lt;/td&gt;

&lt;td&gt;
&lt;asp:Label ID="AnswerMessage" runat="server" /&gt;
&lt;/td&gt;

&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;

&lt;asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"

ErrorMessage="Please enter a value.&lt;br /&gt;" Display="Dynamic" runat="server" /&gt;

&lt;asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"

MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer &lt;br /&gt; between than 1 and 100.&lt;br /&gt;"

Display="Dynamic" runat="server" /&gt;
&lt;/td&gt;
&lt;td colspan="2"&gt;

&lt;asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"

ErrorMessage="Please enter a value.&lt;br /&gt;" Display="Dynamic" runat="server" /&gt;

&lt;asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"

MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer &lt;br /&gt; between than 1 and 100.&lt;br /&gt;"

Display="Dynamic" runat="server" /&gt;
&lt;/td&gt;
&lt;td&gt;

&amp;nbsp
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr align="center"&gt;

&lt;td colspan="4"&gt;
&lt;asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" /&gt;

&lt;/td&gt;
&lt;td&gt;


&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Gets or sets a value indicating whether the contents of the RadInput control can be changed.

C#
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "ReadOnly")]
[Themeable(false)]
public virtual bool ReadOnly { get; set; }
Property Value:

true if the contents of the RadInput control cannot be changed; otherwise, false. The default value is false.

Use the ReadOnly property to specify whether the contents of the RadInput control can be changed. Setting this property to true will prevent users from entering a value or changing the existing value. Note that the user of the RadInput control cannot change this property; only the developer can. The Text value of a RadInput control with the ReadOnly property set to true is sent to the server when a postback occurs, but the server does no processing for a read-only RadInput. This prevents a malicious user from changing a Text value that is read-only. The value of the Text property is preserved in the view state between postbacks unless modified by server-side code. This property cannot be set by themes or style sheet themes.

Example:
cs-api-definition
&lt;/%@ Page Language="C#" AutoEventWireup="True" /%&gt;

&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html&gt;
&lt;head&gt;

&lt;title&gt;MultiLine TextBox Example &lt;/title&gt;


&lt;script runat="server"&gt;
protected void SubmitButton_Click(Object sender, EventArgs e)

{


Message.Text = "Thank you for your comment: &lt;br /&gt;" + Comment.Text;


}


protected void Check_Change(Object sender, EventArgs e)
{


Comment.Wrap = WrapCheckBox.Checked;
Comment.ReadOnly = ReadOnlyCheckBox.Checked;


}


&lt;/script&gt;


&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;h3&gt;

MultiLine TextBox Example
&lt;/h3&gt;
Please enter a comment and click the submit button.

&lt;br /&gt;
&lt;br /&gt;

&lt;radI:RadTextBox ID="Comment" TextMode="MultiLine" Columns="50" Rows="5" runat="server" /&gt;

&lt;br /&gt;
&lt;asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Comment"

ErrorMessage="Please enter a comment.&lt;br /&gt;" Display="Dynamic" runat="server" /&gt;

&lt;asp:CheckBox ID="WrapCheckBox" Text="Wrap Text" Checked="True" AutoPostBack="True"

OnCheckedChanged="Check_Change" runat="server" /&gt;


&lt;asp:CheckBox ID="ReadOnlyCheckBox" Text="ReadOnly" Checked="False" AutoPostBack="True"

OnCheckedChanged="Check_Change" runat="server" /&gt;


&lt;asp:Button ID="SubmitButton" Text="Submit" OnClick="SubmitButton_Click" runat="server" /&gt;

&lt;hr /&gt;
&lt;asp:Label ID="Message" runat="server" /&gt;
&lt;/form&gt;
&lt;/body&gt;

&lt;/html&gt;

Gets the style applied to control when is read only."),

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public InputStyle ReadOnlyStyle { get; }
Property Value:

The style applied to control when is read only."),

C#
protected virtual bool Resizable { get; }

Gets or sets the selection on focus options for the RadInput control

C#
[Themeable(true)]
[ClientControlProperty]
public virtual SelectionOnFocus SelectionOnFocus { get; set; }
Property Value:

A Telerik.WebControls.SelectionOnFocus object that represents the selection on focus in RadInput control. The default value is "None".

  • None
  • CaretToBeginning
  • CaretToEnd
  • SelectAll

Use this property to provide selection on focus of RadInput control. You can set one of the following values:

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;

&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;


&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head id="Head1" runat="server"&gt;

&lt;title&gt;RadTextBox selection&lt;/title&gt;
&lt;script runat="server"&gt;

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{

if (DropDownList1.SelectedValue == "CaretToBeginning")
{

this.RadTextBox1.SelectionOnFocus = Telerik.WebControls.SelectionOnFocus.CaretToBeginning;

}
else if (DropDownList1.SelectedValue == "CaretToEnd")
{

this.RadTextBox1.SelectionOnFocus = Telerik.WebControls.SelectionOnFocus.CaretToEnd;

}
else if (DropDownList1.SelectedValue == "SelectAll")
{

this.RadTextBox1.SelectionOnFocus = Telerik.WebControls.SelectionOnFocus.SelectAll;

}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;form id="form1" runat="server"&gt;
&lt;div&gt;

&lt;radI:RadTextBox SelectionOnFocus="CaretToBeginning" ID="RadTextBox1" runat="server"&gt;&lt;/radI:RadTextBox&gt;

&lt;br /&gt;

&lt;asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"&gt;

&lt;asp:ListItem Text="CaretToBeginning"&gt;CaretToBeginning&lt;/asp:ListItem&gt;

&lt;asp:ListItem Text="CaretToEnd"&gt;CaretToEnd&lt;/asp:ListItem&gt;

&lt;asp:ListItem Text="SelectAll"&gt;SelectAll&lt;/asp:ListItem&gt;

&lt;/asp:DropDownList&gt;&lt;/div&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Gets or sets whether the textbox width should be recalculated and reset in pixels on the client. This prevents textbox expansion in Internet Explorer if the textbox content is too long, but can cause unexpected side effects, depending on the particular scenario. The default value is TRUE.

C#
[ClientControlProperty]
public bool ShouldResetWidthInPixels { get; set; }
Property Value:

The textbox width should be recalculated and reset in pixels on the client. This prevents textbox expansion in Internet Explorer if the textbox content is too long, but can cause unexpected side effects, depending on the particular scenario. The default value is TRUE.

Gets or sets a value indicating whether the button is displayed in the RadInput control.

C#
[ClientControlProperty]
public virtual bool ShowButton { get; set; }
Property Value:

true if the button is displayed; otherwise, false. The default value is true, however this property is only examined when the ButtonTemplate property is not a null reference (Nothing in Visual Basic).

Use the ShowButton property to specify whether the button is displayed in the RadInput control.

The contents of the button are controlled by the ButtonTemplate property.

Example:
C#
&lt;/%@ Page Language="C#" /%&gt;
&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;



&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head id="Head1" runat="server"&gt;

&lt;title&gt;Untitled Page&lt;/title&gt;

&lt;script language="javascript" type="text/javascript"&gt;
function Click(sender)
{

alert("click");
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;form id="form1" runat="server"&gt;

&lt;radI:RadTextBox ShowButton="true" ID="RadNumericTextBox1" runat="server"&gt;

&lt;ClientEvents OnButtonClick="Click" /&gt;
&lt;ButtonTemplate&gt;

&lt;input type="button" value="click here"  /&gt;
&lt;/ButtonTemplate&gt;

&lt;/radI:RadTextBox&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Gets or sets the skin name for the control user interface.

C#
public override string Skin { get; set; }
Property Value:

A string containing the skin name for the control user interface. The default is string.Empty.

Overrides: RadWebControl.Skin

If this property is not set, the control will render using the skin named "Default". If EnableEmbeddedSkins is set to false, the control will not render skin.

Gets or sets the skin to apply to the control.

C#
public override string SkinID { get; set; }
Property Value:

The name of the skin to apply to the control. The default is Empty.

Exceptions: InvalidOperationException

The style sheet has already been applied.- or -The Page_PreInit event has already occurred.- or -The control was already added to the Controls collection.

Overrides: RadWebControl.SkinID

C#
protected override bool SupportsRenderingMode { get; }

Overrides: RadWebControl.SupportsRenderingMode

Gets or sets the tab index of the Web server control.

C#
public override short TabIndex { get; set; }
Property Value:

The tab index of the Web server control. The default is 0, which indicates that this property is not set.

Exceptions: ArgumentOutOfRangeException

The specified tab index is not between -32768 and 32767.

Overrides: RadWebControl.TabIndex

C#
protected override HtmlTextWriterTag TagKey { get; }

Overrides: WebControl.TagKey

C#
protected override string TagName { get; }

Overrides: WebControl.TagName

Gets or sets the text content of the RadInput control.

C#
[Bindable(true, BindingDirection.TwoWay)]
public virtual string Text { get; set; }
Property Value:

The text displayed in the RadInput control. The default is an empty string ("").

Implements: ITextControl.Text

Use the Text property to specify or determine the text displayed in the RadInput control. To limit the number of characters accepted by the control, set the MaxLength property. If you want to prevent the text from being modified, set the ReadOnly property.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool.

Example:
cs-api-definition
&lt;/%@ Page Language="C#" AutoEventWireup="True" /%&gt;

&lt;/%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="radI" /%&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html&gt;
&lt;head&gt;

&lt;title&gt;RadTextBox Example &lt;/title&gt;


&lt;script runat="server"&gt;




protected void AddButton_Click(object sender, EventArgs e)
{

int Answer;


Answer = Convert.ToInt32(Value1.Text) + Convert.ToInt32(Value2.Text);


AnswerMessage.Text = Answer.ToString();
}
&lt;/script&gt;


&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;h3&gt;

RadTextBox Example
&lt;/h3&gt;
&lt;table&gt;
&lt;tr&gt;

&lt;td colspan="5"&gt;
Enter integer values into the text boxes.

&lt;br /&gt;
Click the Add button to add the two values.

&lt;br /&gt;
Click the Reset button to reset the text boxes.

&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="5"&gt;


&lt;/td&gt;
&lt;/tr&gt;
&lt;tr align="center"&gt;

&lt;td&gt;
&lt;radI:RadTextBox ID="Value1" Columns="2" MaxLength="3" Text="1" runat="server" /&gt;

&lt;/td&gt;
&lt;td&gt;
+
&lt;/td&gt;

&lt;td&gt;
&lt;radI:RadTextBox ID="Value2" Columns="2" MaxLength="3" Text="1" runat="server" /&gt;

&lt;/td&gt;
&lt;td&gt;
=
&lt;/td&gt;

&lt;td&gt;
&lt;asp:Label ID="AnswerMessage" runat="server" /&gt;

&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;

&lt;asp:RequiredFieldValidator ID="Value1RequiredValidator" ControlToValidate="Value1"

ErrorMessage="Please enter a value.&lt;br /&gt;" Display="Dynamic" runat="server" /&gt;

&lt;asp:RangeValidator ID="Value1RangeValidator" ControlToValidate="Value1" Type="Integer"

MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer &lt;br /&gt; between than 1 and 100.&lt;br /&gt;"

Display="Dynamic" runat="server" /&gt;
&lt;/td&gt;

&lt;td colspan="2"&gt;

&lt;asp:RequiredFieldValidator ID="Value2RequiredValidator" ControlToValidate="Value2"

ErrorMessage="Please enter a value.&lt;br /&gt;" Display="Dynamic" runat="server" /&gt;

&lt;asp:RangeValidator ID="Value2RangeValidator" ControlToValidate="Value2" Type="Integer"

MinimumValue="1" MaximumValue="100" ErrorMessage="Please enter an integer &lt;br /&gt; between than 1 and 100.&lt;br /&gt;"

Display="Dynamic" runat="server" /&gt;
&lt;/td&gt;
&lt;td&gt;

&amp;nbsp
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr align="center"&gt;

&lt;td colspan="4"&gt;

&lt;asp:Button ID="AddButton" Text="Add" OnClick="AddButton_Click" runat="server" /&gt;

&lt;/td&gt;
&lt;td&gt;


&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;

&lt;/html&gt;
C#
protected string TextElementID { get; set; }

Gets or sets the text displayed when the mouse pointer hovers over the Web server control.

C#
public override string ToolTip { get; set; }
Property Value:

The text displayed when the mouse pointer hovers over the Web server control. The default is Empty.

Overrides: RadWebControl.ToolTip

Gets or sets the group of controls for which the ra.a.d.input control causes validation when it posts back to the server.

C#
[Themeable(false)]
public virtual string ValidationGroup { get; set; }
Property Value:

The group of controls for which the RadInput control causes validation when it posts back to the server. The default value is an empty string ("").

Validation groups allow you to assign validation controls on a page to a specific category. Each validation group can be validated independently from other validation groups on the page. Use the ValidationGroup property to specify the name of the validation group for which the RadInput control causes validation when it posts back to the server.

This property has an effect only when the CausesValidation property is set to true. When you specify a value for the ValidationGroup property, only the validation controls that are part of the specified group are validated when the RadInput control posts back to the server. If you do not specify a value for this property and the CausesValidation property is set to true, all validation controls on the page that are not assigned to a validation group are validated when the control posts back to the server.

This property cannot be set by themes or style sheet themes.

Gets the validation text which is used when validation of the RadInputControl fails.

C#
public virtual string ValidationText { get; }
Property Value:

The validation text which is used when validation of the RadInputControl fails.

Gets or sets a value that indicates whether a server control is rendered as UI on the page.

C#
public override bool Visible { get; set; }
Property Value:

true if the control is visible on the page; otherwise false.

Overrides: RadWebControl.Visible

Gets or sets the width of the Web server control.

C#
public override Unit Width { get; set; }
Property Value:

A Unit that represents the width of the control. The default is Empty.

Exceptions: ArgumentException

The width of the Web server control was set to a negative value.

Overrides: RadWebControl.Width

Gets or sets the wrapper CSS class which holds the HTML input element.

C#
public virtual string WrapperCssClass { get; set; }
Property Value:

The wrapper CSS class which holds the HTML input element.

Methods

C#
protected override void AddAttributesToRender(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.AddAttributesToRender(HtmlTextWriter)

C#
protected virtual void ApplyCurrentCssClass(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected virtual Unit CalculateInputWidth()
Returns:

Unit

C#
protected Unit CalculateWrapperWidth()
Returns:

Unit

Code moved into this method from OnPreRender to make sure it executed when the framework skips OnPreRender() for some reason

C#
protected override void ControlPreRender()

Overrides: RadWebControl.ControlPreRender()

C#
protected override void CreateChildControls()

Overrides: Control.CreateChildControls()

C#
protected override void DescribeClientEvents(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeClientEvents(IScriptDescriptor)

C#
protected override void DescribeClientProperties(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeClientProperties(IScriptDescriptor)

C#
protected override void DescribeComponent(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Overrides: RadWebControl.DescribeComponent(IScriptDescriptor)

C#
protected virtual void DescribeValueAndTextProperties(IScriptDescriptor descriptor)
Parameters:descriptorIScriptDescriptor

Sets input focus to a RadInput.

C#
public override void Focus()

Overrides: Control.Focus()

Use the Focus method to set the initial focus of the Web page to the RadInput. The page will be opened in the browser with the control selected.

The Focus method causes a call to the page focus script to be emitted on the rendered page. If the page does not contain a control with an HTML ID attribute that matches the control that the Focus method was invoked on, then page focus will not be set. An example where this can occur is when you set the focus on a user control instead of setting the focus on a child control of the user control. In this scenario, you can use the FindControl method to find the child control of the user control and invoke its Focus method.

C#
protected string FormatCssClass(string prefix, string userDefined)
Parameters:prefixstringuserDefinedstringReturns:

string

C#
protected virtual string GetOffsetAdditionalClasses()
Returns:

string

C#
protected virtual string GetPostBackEventReference()
Returns:

string

C#
protected virtual bool IsMultiLine()
Returns:

bool

C#
protected virtual bool isOnlyInputRendered()
Returns:

bool

Loads the client state data

C#
protected override void LoadClientState(Dictionary<string, object> clientState)
Parameters:clientStateDictionary<string, object>

Overrides: RadWebControl.LoadClientState(Dictionary<string, object>)

Executed when post data is loaded from the request

C#
protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection)
Parameters:postDataKeystringpostCollectionNameValueCollectionReturns:

bool

Overrides: RadWebControl.LoadPostData(string, NameValueCollection)

C#
protected override void LoadViewState(object savedState)
Parameters:savedStateobject

Overrides: WebControl.LoadViewState(object)

C#
protected virtual void MergeAuxiliaryStyles()
C#
protected virtual void MergeStyles()
C#
protected virtual void OnChildrenCreated()
C#
protected virtual void OnTextChanged(EventArgs e)
Parameters:eEventArgs

Executed when post data changes should invoke a changed event

C#
protected override void RaisePostDataChangedEvent()

Overrides: RadWebControl.RaisePostDataChangedEvent()

Registers the control with the ScriptManager

C#
protected override void RegisterScriptControl()

Overrides: RadWebControl.RegisterScriptControl()

C#
protected virtual void RenderBeginTagSingleInput(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected virtual void RenderBrowserSpecificStyles(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected override void RenderChildren(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: Control.RenderChildren(HtmlTextWriter)

C#
protected override void RenderContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.RenderContents(HtmlTextWriter)

C#
protected virtual void RenderContentsSingleInput(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected virtual void RenderContentsSingleInputFields(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected virtual void RenderInnerWrapperContent(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected virtual void RenderLabel(HtmlTextWriter writer, string forID)
Parameters:writerHtmlTextWriterforIDstring
C#
protected virtual void RenderPasswordStrengthIndicator(HtmlTextWriter writer, bool inTable)
Parameters:writerHtmlTextWriterinTablebool
C#
protected virtual void RenderTextAreaContents(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected override object SaveViewState()
Returns:

object

Overrides: WebControl.SaveViewState()

C#
protected virtual void SetDefaultSize()
C#
protected virtual void SetDesignTimeAttributes(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter
C#
protected virtual void SetStyleClasses()
C#
protected virtual bool shouldRenderWhiteSpace()
Returns:

bool

C#
protected virtual string StylesToClient()
Returns:

string

C#
protected override void TrackViewState()

Overrides: WebControl.TrackViewState()

Events

Occurs after all child controls of the RadDateInput control have been created. You can customize the control there, and add additional child controls.

C#
public event EventHandler ChildrenCreated
C#
public event EventHandler TextChanged

Implements: IEditableTextControl.TextChanged

In this article
DefinitionConstructorsRadInputControl()FieldssetHeightsetStylesetWidthPropertiesAccessKeyAutoCompleteTypeAutoPostBackBackColorBorderColorBorderStyleBorderWidthBrowserButtonContainerButtonCssClassButtonsLightContainerButtonsPositionCausesValidationClientEventsCssClassdefaultWidthDisabledStyleDisplayDisplayTextEmptyMessageEmptyMessageStyleEmptySkinEnableAjaxSkinRenderingEnableAriaSupportEnabledEnabledStyleEnableEmbeddedBaseStylesheetEnableEmbeddedScriptsEnableEmbeddedSkinsEnableOldBoxModelEnableSingleInputRenderingEnableThemingEnableViewStateFocusedStyleHeightHoveredStyleInvalidInvalidStyleInvalidStyleDurationLabelLabelCssClassLabelWidthLastSetTextBoxValueMaxLengthReadOnlyReadOnlyStyleResizableSelectionOnFocusShouldResetWidthInPixelsShowButtonSkinSkinIDSupportsRenderingModeTabIndexTagKeyTagNameTextTextElementIDToolTipValidationGroupValidationTextVisibleWidthWrapperCssClassMethodsAddAttributesToRender(HtmlTextWriter)ApplyCurrentCssClass(HtmlTextWriter)CalculateInputWidth()CalculateWrapperWidth()ControlPreRender()CreateChildControls()DescribeClientEvents(IScriptDescriptor)DescribeClientProperties(IScriptDescriptor)DescribeComponent(IScriptDescriptor)DescribeValueAndTextProperties(IScriptDescriptor)Focus()FormatCssClass(string, string)GetOffsetAdditionalClasses()GetPostBackEventReference()IsMultiLine()isOnlyInputRendered()LoadClientState(Dictionary<string, object>)LoadPostData(string, NameValueCollection)LoadViewState(object)MergeAuxiliaryStyles()MergeStyles()OnChildrenCreated()OnTextChanged(EventArgs)RaisePostDataChangedEvent()RegisterScriptControl()RenderBeginTagSingleInput(HtmlTextWriter)RenderBrowserSpecificStyles(HtmlTextWriter)RenderChildren(HtmlTextWriter)RenderContents(HtmlTextWriter)RenderContentsSingleInput(HtmlTextWriter)RenderContentsSingleInputFields(HtmlTextWriter)RenderInnerWrapperContent(HtmlTextWriter)RenderLabel(HtmlTextWriter, string)RenderPasswordStrengthIndicator(HtmlTextWriter, bool)RenderTextAreaContents(HtmlTextWriter)SaveViewState()SetDefaultSize()SetDesignTimeAttributes(HtmlTextWriter)SetStyleClasses()shouldRenderWhiteSpace()StylesToClient()TrackViewState()EventsChildrenCreatedTextChanged
Not finding the help you need?
Contact Support