# Events

You can subscribe to the [available DataSource events](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/datasourceeventbuilder) and further customize the behavior of the DataSource.

## Handling by Handler Name

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

```Razor HtmlHelper
   @(Html.Kendo().DataSource<ProductViewModel>()
        .Name("dataSource1")
        .Ajax(dataSource => dataSource
            .Events(ev => ev.RequestStart("onRequestStart"))
            .Read(read => read.Action("Products_Read", "DataSource"))
            ... // Additional configuration
        )
    )

    <script>
        function onRequestStart(e){
            // Handle the RequestStart event that triggers the DataSource makes a request to the remote service.
        }
    </script>
```

## Handling by Template Delegate

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

```Razor HtmlHelper
   @(Html.Kendo().DataSource<ProductViewModel>()
        .Name("dataSource1")
        .Ajax(dataSource => dataSource
            .Read(read => read.Action("Products_Read", "DataSource"))
            .Events(e => e.RequestStart(@<text>
                function() {
                    // Handle the RequestStart event inline.
                }
                </text>)
            )
            ... // Additional configuration
        )
    )
```

## See Also

* [DataSource Server-Side API for ASP.NET MVC](https://www.telerik.com/aspnet-mvc/documentation/api/datasource)

* [DataSource Client-Side API](https://docs.telerik.com/kendo-ui/api/data/datasource)
