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

Events

The Telerik UI Notification 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 Notification events, refer to the demo on using the events of the Notification.

Handling by Handler Name

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

    @(Html.Kendo().Notification()
        .Name("notification")
        .Position(p=>p.Top(120).Left(20))
        .Events(e => e
            .Show("notification_show")
            .Hide("notification_hide")
        )
    )
    <kendo-notification name="notification" on-show="notification_show" on-hide="notification_hide">
         <position top="120" left="20"></position>
    </kendo-notification>
    <script>
        function notification_show() {
            // Handle the show event.
        }

        function notification_hide() {
            // Handle the hide event.
        }
    </script>

Handling by Template Delegate

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

    @(Html.Kendo().Notification()
        .Name("notification")
        .Position(p=>p.Top(120).Left(20))
        .Events(e => e
            .Show(@<text>
                function() {
                    // Handle the show event inline.
                }
            </text>)
            .Hide(@<text>
                function() {
                    // Handle the hide event inline.
                }
            </text>)
        )
    )
    <kendo-notification name="notification"
     on-show="function() {
        //Handle the show event inline.
    }"
     on-hide="function() {
       //Handle the hide event inline.
    }">
    </kendo-notification>

Next Steps

See Also

In this article