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

Server-side Events

Event log

This example shows how to get and set the value of RadDateInput control server-side. You can wire the OnTextChanged server-side event which will be raised when the AutoPostBack property of the corresponding RadInput control is set to true, the user types valid entry and the input loses focus.

Change the data in any of the input controls and loose its focus - its TextChanged event will fire and returns the control value.

Related Resources

  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" CodeFile="DefaultCS.aspx.cs" AutoEventWireup="false" Inherits="Telerik.NumericTextBox.ServerSide.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecorationZoneID="demo-containers" />
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadDateInput1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="EventLogConsole1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <div class="demo-containers">
        <div class="demo-container">
            <telerik:RadLabel runat="server" ID="RadLabel1" AssociatedControlID="RadDateInput1" Text="RadDateInput"></telerik:RadLabel>
            <telerik:RadDateInput RenderMode="Lightweight" OnTextChanged="RadDateInput1_TextChanged" ID="RadDateInput1"
                EmptyMessage="Enter a valid date" runat="server" AutoPostBack="True" InvalidStyleDuration="100">
            </telerik:RadDateInput>
        </div>
    </div>

    <qsf:EventLogConsole runat="server" ID="EventLogConsole1" AllowClear="true"></qsf:EventLogConsole>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance