Calendar Validation in asp.net using vb.net -
how can forbid past date chosen in calendar?
this asp code:
<td> <asp:calendar id="calendar1" runat="server"></asp:calendar> </td>
use dayrender
event of calendar
control.
.aspx:
<asp:calendar id="calendar1" runat="server" selectionmode="none" ondayrender="calendar1_dayrender" </asp:calendar>
and event in code behind::
protected sub calendar1_dayrender(sender object, e dayrendereventargs) handles calendar1.dayrender if e.day.date < date.today e.day.isselectable = false e.cell.forecolor = system.drawing.color.gray end if end sub
Comments
Post a Comment