ASP.NET Calendar OtherMonthDayStyle property
Definition and Usage
OtherMonthDayStyle property sets or returns a calendar month does not belong to the style of the current date.
grammar
<asp:Calendar runat="server">
<OtherMonthDayStylestyle="value" />
</asp:Calendar>
or
<asp:Calendar runat="server" OtherMonthDayStyle-style="value" />
<OtherMonthDayStylestyle="value" />
</asp:Calendar>
or
<asp:Calendar runat="server" OtherMonthDayStyle-style="value" />
属性 | 描述 |
---|---|
style | 规定要设置的样式。请参阅 Style 控件 ,查看可能的样式以及它们的值。 |
value | 规定指定样式的值。 |
Example 1
The following example shows a method of setting the calendar OtherMonthDayStyle:
<form runat="server">
<asp:Calendar id="cal1" runat="server">
<OtherMonthDayStyle ForeColor="#FF0000" />
</asp:Calendar>
</form>
<asp:Calendar id="cal1" runat="server">
<OtherMonthDayStyle ForeColor="#FF0000" />
</asp:Calendar>
</form>
The demonstration >>
Example 2
The following example shows another way to set the calendar OtherMonthDayStyle:
<form runat="server">
<asp:Calendar id="cal2" runat="server"
OtherMonthDayStyle-ForeColor="#FF0000" />
</form>
<asp:Calendar id="cal2" runat="server"
OtherMonthDayStyle-ForeColor="#FF0000" />
</form>
Try - Demo
Setting Calendar control OtherMonthDayStyle (with declaration and script)
Calendar Control