Events
The Telerik UI Notification for ASP.NET MVC 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")
)
)
<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>)
)
)