This example shows the client-side events supported by Telerik Numeric TextBox for ASP.NET MVC.

The numeric textbox has the following events:

- The OnLoad event is raised when the component is initialized. You can subscribe to that event by using one of the two overloads of the OnLoad method. The one accepts Action as an argument - the other accepts a String. Use the Action overload to define the event handler inline. Use the String overload to specify the name of the JavaScript function which handles the event. The following code shows both options:

      <%= Html.Telerik().NumericTextBox()
              .Name("NumericTextBox")
              .ClientEvents(events => events
                  .OnLoad("onLoad")
              )

  or

      <% Html.Telerik().NumericTextBox()
             .Name("NumericTextBox")
             .ClientEvents(events => events
             .OnLoad(() =>
             {
              %>
               function(e) {
                   //perform required actions here.
               }
              <%
             })
             .Render();

- The OnChange event is raised when the currently selected value is changed. You can subscribe to that event by using one of the two overloads of the OnChange method:

      <%= Html.Telerik().NumericTextBox()
              .Name("NumericTextBox")
              .ClientEvents(events => events
                  .OnChange("onChange")
              )

  or

      <% Html.Telerik().NumericTextBox()
             .Name("NumericTextBox")
             .ClientEvents(events => events
             .OnChange(() =>
             {
                 %>
                  function(e) {
                      //perform required actions here.
                  }
                 <%
             })
             .Render();