ASP.NET Calendar - Knowledge Base

« Back to Knowledge Base list

Handle the month changed event

Q:

Is there a way to call a client side function when the user clicks the ">>" symbol or the "<<" symbol to change months?

A:

Yes, this is possible, using the "OnClientMonthScrollLeft" and "OnClientMonthScrollRight" client-side events:

<obout:Calendar runat="server" ID="Calendar1"
        OnClientMonthScrollLeft="Calendar1_MonthScrollLeft" OnClientMonthScrollRight="Calendar1_MonthScrollRight" />

<script type="text/javascript">
    function Calendar1_MonthScrollLeft() {
        alert('Calendar1_MonthScrollLeft');
    }

    function Calendar1_MonthScrollRight() {
        alert('Calendar1_MonthScrollRight');
    }
</script>