Getting Started
  Introduction
  What is ASP.NET?
  Language Support

ASP.NET Web Forms
  Introducing Web Forms
  Working with Server Controls
  Applying Styles to Controls
  Server Control Form Validation
  Web Forms User Controls
  Data Binding Server Controls
  Server-Side Data Access
  Data Access and Customization
  Working with Business Objects
  Authoring Custom Controls
  Web Forms Controls Reference
  Web Forms Syntax Reference

ASP.NET Web Services
  Introducing Web Services
  Writing a Simple Web Service
  Web Service Type Marshalling
  Using Data in Web Services
  Using Objects and Intrinsics
  The WebService Behavior
  HTML Pattern Matching

ASP.NET Web Applications
  Application Overview
  Using the Global.asax File
  Managing Application State
  HttpHandlers and Factories

Cache Services
  Caching Overview
  Page Output Caching
  Page Fragment Caching
  Page Data Caching

Configuration
  Configuration Overview
  Configuration File Format
  Retrieving Configuration

Deployment
  Deploying Applications
  Using the Process Model
  Handling Errors

Security
  Security Overview
  Authentication & Authorization
  Windows-based Authentication
  Forms-based Authentication
  Authorizing Users and Roles
  User Account Impersonation
  Security and WebServices

Localization
  Internationalization Overview
  Setting Culture and Encoding
  Localizing ASP.NET Applications
  Working with Resource Files

Tracing
  Tracing Overview
  Trace Logging to Page Output
  Application-level Trace Logging

Debugging
  The SDK Debugger

Performance
  Performance Overview
  Performance Tuning Tips
  Measuring Performance

ASP to ASP.NET Migration
  Migration Overview
  Syntax and Semantics
  Language Compatibility
  COM Interoperability
  Transactions

Sample Applications
  A Personalized Portal
  An E-Commerce Storefront
  A Class Browser Application
  IBuySpy.com

  Get URL for this page

Calendar


Working With Calendar

The Calendar control displays a month calendar from which users can select dates. The following sample illustrates using a simple Calendar control.

 
VB Calendar1.aspx

[Run Sample] | [View Source]

Date Selection Modes

Calendar supports four date selection modes, as described in the following table.

Mode Description
Day User can select any single day.
DayWeek User can select a single day, or an entire week.
DayWeekMonth User can select a single day, an entire week, or the entire visible month.
None Date selection is disabled.

The following sample demonstrates mode selection with a Calendar control.

 
VB Calendar2.aspx

[Run Sample] | [View Source]

Selection Link Graphics

The Calendar control can use either text or graphics for its selection links. The following sample shows how to use graphics to create a better-looking calendar.

 
VB Calendar3.aspx

[Run Sample] | [View Source]

Selection Link Text

The Calendar control can also use text labels for week or month selection, as shown in the following example.

 
VB Calendar4.aspx

[Run Sample] | [View Source]

Adding Custom Content to Calendar

You can make appointment-style calendars by adding content in the OnDayRender event. Two of the arguments for OnDayRender are the Day that is being rendered and its Cell object. Custom text can be added to the cell for a particular day by adding it as a LiteralControl to the Cell object's Controls collection, as shown in the following example.

VB

 
VB Calendar5.aspx

[Run Sample] | [View Source]


Copyright 2001 Microsoft Corporation. All rights reserved.