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

Events

The Telerik UI MaskedTextBox for ASP.NET Core exposes multiple events that allow you to control and customize the behavior of the UI component.

For a complete example on basic MaskedTextBox events, refer to the demo on using the events of the MaskedTextBox.

Handling by Handler Name

The following example demonstrates how to subscribe to events by a handler name.

  @(Html.Kendo().MaskedTextBox()
        .Name("maskedtextbox")
        .Events(e => e
            .Change("maskedtextbox_change")
        )
  )
<kendo-maskedtextbox name="maskedtextbox"
               on-change="maskedtextbox_change">
</kendo-maskedtextbox>
  <script>
  function maskedtextbox_change() {
      // Handle the change event.
  }
  </script>

Handling by Template Delegate

The following example demonstrates how to subscribe to events by a template delegate.

    @(Html.Kendo().MaskedTextBox()
        .Name("maskedtextbox")
        .Events(e => e
            .Change(@<text>
                function() {
                    // Handle the change event inline.
                }
            </text>)
        )
    )
    <kendo-maskedtextbox name="maskedtextbox"
                         on-change="
                         function() {
                           // Handle the change event inline.
                         }">
    </kendo-maskedtextbox>

Next Steps

See Also

In this article