Asp.net calendar do not render previous/next days
How to do it. For example the calend开发者_运维百科ar for march will also show days from feb and april. I dont want them to be shown. How to do. Anyone have sample code?
In the DayRender event, check the date. If it falls in the previous or the next month, make the cell's text a
public void objCalendar_DayRender(object sender, DayRenderEventArgs e)
{
CalendarDay d = ((DayRenderEventArgs)e).Day;
TableCell c = ((DayRenderEventArgs)e).Cell;
if (d.IsOtherMonth)
{
c.Controls.Clear();
}
else
{
//stuff
}
}
精彩评论