Custom filtering of MVC Events widget
MVC events widget contains various predefined options to filter the list of displayed events. Although you can adjust almost every setting in the designer, you may want to extend the business logic behind some of these default filtering options. This tutorial will demonstrate how to extend a Events widget.
Perform the following:
- Create a new class that represents you new business logic for the Events widget.
Create a CustomEventModel
class that inherits from the default EventModel
.
In this example, you additionally filter all events with title that contains Some Title text:
- Replace the original implementation of the Events widget model with the new model.
You do this using the Bootstrapper.Bootstrapped
event.
Place the following code in your Global.asax
file:
RESULT: You changed the default filtering of events due to the many virtual implementations of all controller methods and model methods.