# Events

The Telerik UI SpeechToTextButton for ASP.NET MVC [exposes events](https://www.telerik.com/aspnet-mvc/documentation/api/kendo.mvc.ui.fluent/speechtotextbuttoneventbuilder) like `Start`, `End`, `Result`, and `Error`, that allow you to control the behavior of the UI component.

For a complete example on basic SpeechToTextButton events, refer to the [demo on using the events of the SpeechToTextButton](https://demos.telerik.com/aspnet-mvc/speechtotextbutton/events).

## Handling by Handler Name

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

```Razor HtmlHelper
@(Html.Kendo().SpeechToTextButton()
    .Name("speechButton")
    .Events(ev => ev.Result("onResult"))
)
```

```JS Scripts
<script>
    function onResult(e){
        // Handle the SpeechToTextButton "Result" event that triggers when the speech recognition service returns a result (a word or phrase has been positively recognized).
    }
</script>
```

## Handling by Template Delegate

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

```Razor HtmlHelper
@(Html.Kendo().SpeechToTextButton()
    .Name("speechButton")
    .Events(e => e.Result(@<text>
        function() {
            // Handle the SpeechToTextButton "Result" event inline.
        }
        </text>)
    )
)
```

## Next Steps

* [Using the SpeechToTextButton Events (Demo)](https://demos.telerik.com/aspnet-mvc/speechtotextbutton/events)

## See Also

* [Using the API of the SpeechToTextButton for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/speechtotextbutton/api)
* [Client-Side API of the SpeechToTextButton](https://docs.telerik.com/kendo-ui/api/ui/speechtotextbutton)
* [Server-Side API of the SpeechToTextButton](https://www.telerik.com/aspnet-mvc/documentation/api/speechtotextbutton)
