asp.net.ph

Calendar Class

System.Web.UI.WebControls Namespace


Displays a single month calendar that allows the user to select a specific day, week, or month.

Calendar Class Members

Collapse   Constructors

Visibility Constructor Parameters
public Calendar ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public Caption String [ Get , Set ]
public CaptionAlign TableCaptionAlign [ Get , Set ]
public CellPadding Int32 [ Get , Set ]
public CellSpacing Int32 [ Get , Set ]
public DayHeaderStyle TableItemStyle [ Get ]
public DayNameFormat DayNameFormat [ Get , Set ]
public DayStyle TableItemStyle [ Get ]
public FirstDayOfWeek FirstDayOfWeek [ Get , Set ]
public NextMonthText String [ Get , Set ]
public NextPrevFormat NextPrevFormat [ Get , Set ]
public NextPrevStyle TableItemStyle [ Get ]
public OtherMonthDayStyle TableItemStyle [ Get ]
public PrevMonthText String [ Get , Set ]
public SelectedDate DateTime [ Get , Set ]
public SelectedDates SelectedDatesCollection [ Get ]
public SelectedDayStyle TableItemStyle [ Get ]
public SelectionMode CalendarSelectionMode [ Get , Set ]
public SelectMonthText String [ Get , Set ]
public SelectorStyle TableItemStyle [ Get ]
public SelectWeekText String [ Get , Set ]
public ShowDayHeader Boolean [ Get , Set ]
public ShowGridLines Boolean [ Get , Set ]
public ShowNextPrevMonth Boolean [ Get , Set ]
public ShowTitle Boolean [ Get , Set ]
public SupportsDisabledAttribute Boolean [ Get ]
public TitleFormat TitleFormat [ Get , Set ]
public TitleStyle TableItemStyle [ Get ]
public TodayDayStyle TableItemStyle [ Get ]
public TodaysDate DateTime [ Get , Set ]
public UseAccessibleHeader Boolean [ Get , Set ]
public VisibleDate DateTime [ Get , Set ]
public WeekendDayStyle TableItemStyle [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
protected CreateControlCollection ( ) ControlCollection
protected HasWeekSelectors ( CalendarSelectionMode selectionMode ) Boolean
protected LoadViewState ( Object savedState ) Void
protected OnDayRender ( TableCell cell , CalendarDay day ) Void
protected OnSelectionChanged ( ) Void
protected OnVisibleMonthChanged ( DateTime newDate , DateTime previousDate ) Void
protected RaisePostBackEvent ( String eventArgument ) Void
protected SaveViewState ( ) Object
protected TrackViewState ( ) Void

Remarks

While databinding is not supported for this control, the user may modify the contents of any day by hooking the DayRender event.

Example

The following example illustrates how to declare a Calendar control at design time.

<html>
<body>
<h3>Calendar Example</h3>
<form runat = "server">

   <asp:calendar runat = "server"
      font-size=11pt
      cellpadding=5 cellspacing=5
      borderstyle = "groove" borderwidth=2
      showgridlines=true
      nextprevformat = "ShortMonth"
      nextprevstyle-forecolor = "white"
      nextprevstyle-font-size=8pt>
   
      <titlestyle
         backcolor = "steelblue"
         forecolor = "white"
         font-size=11pt
         font-bold />
   
      <dayheaderstyle
         font-bold
         forecolor = "khaki"
         backcolor = "maroon" />
   
      <weekenddaystyle
         backcolor = "palegoldenrod"
         width = "50px"
         height = "50px" />
   
      <todaydaystyle
         font-bold
         forecolor = "blue"
         borderwidth=3 />
   
      <selecteddaystyle
         backcolor = "darkgreen"
         font-bold />
   
      <othermonthdaystyle
         forecolor = "gray"
         width = "50px"
         height = "50px" />
   
   </asp:calendar>

</form>
</body>
</html>

 Show me 

Skip Navigation Links



Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph