# Events

The ColorPicker for ASP.NET MVC exposes the [`Change()`](https://docs.telerik.com/aspnet-mvc/api/kendo.mvc.ui.fluent/colorpickereventbuilder#changesystemstring), [`Select()`](https://docs.telerik.com/aspnet-mvcapi/kendo.mvc.ui.fluent/colorpickereventbuilder#selectsystemstring), [`Open()`](https://docs.telerik.com/aspnet-mvc/api/kendo.mvc.ui.fluent/colorpickereventbuilder#opensystemstring), and the [`Close()`](https://docs.telerik.com/aspnet-mvc/api/kendo.mvc.ui.fluent/colorpickereventbuilder#closesystemstring) events that you can use to further manipulate the component or other HTML elements as per your requirements.

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

### Handling by Handler Name

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

```Razor HtmlHelper
    @(Html.Kendo().ColorPicker()
        .Name("colorpicker")
        .Events(e => e
            .Open("colorpicker_open")
            .Close("colorpicker_close")
            .Select("colorpicker_select")
            .Change("colorpicker_change")
        )
    )
    <script>
        // The ColorPicker instance is available as an e.sender or this.
        function colorpicker_open(e) {
            // Handle the open event.
        }

        function colorpicker_close(e) {
            // Handle the close event.
        }

        function colorpicker_select(e) {
            // Handle the select event.
        }

        function colorpicker_change(e) {
            // Handle the change event.
        }
    </script>
```

### Handling by Template Delegate

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

```Razor HtmlHelper
    @(Html.Kendo().ColorPicker()
          .Name("colorpicker")
          .Events(e => e
              .Open(@<text>
                function(e) {
                    //Handle the open event inline.
                }
              </text>)
              .Close(@<text>
                function(e) {
                    //Handle the close event inline.
                }
                </text>)
              .Select(@<text>
                function(e) {
                    //Handle the select event inline.
                }
                </text>)
              .Change(@<text>
                function(e) {
                    //Handle the change event inline.
                }
                </text>)
          )
    )
```

## Next Steps

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

## See Also

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