ASP.NET Calendar: Hide PrevMonthText or NextMonthText

If you use the ASP.NET Calendar Control and want to hide the PrevMonthText or NextMonthText then you need to use the PreRender-Event from the Calendar-Control.

In this example I hide the PrevMonthText (Hyperlink) when the current year and month equals calendars visible year and month. Note: You must set/init the VisibileDate-Property in Page_Load-Event. In my example I want that the start month and year of the control is set to today.

Leave a Reply

Your email address will not be published. Required fields are marked *