Article
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    API(s)
    Sencha-Touch
    Single Page App
    Bootstrap
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog

Home >> ASP.Net & Web Forms >> Calendar Control in ASP.Net
Calendar Control in ASP.Net
Calendar Control in ASP.Net


by Pushpendra Singh on 10/20/2010 3:55:35 PM

Views: 3298       Comments: 0

Calendar Control in ASP.Net

Ideally Calendar control is used to display calendar for a month and allows navigating backward & forward through days, and months. This control is highly customizable in terms of functionality and appearance.

<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>

Calendar Control in ASP.Net

The Calendar control is used to display a one-month calendar that allows the user to select dates and move to the next and previous months.

Date Selection Modes

By setting the Selection Mode property, you can specify whether the user can select a single day, a week, or a month, or you can disable date selection entirely.

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

Mode

Description

Day

User can select any single day.

Day Week

User can select a single day, or an entire week.

Day Week Month

User can select a single day, an entire week, or the entire visible month.

None

Date selection is disabled.

Calendar Control in ASP.Net

 

 

Calendar event

It has selection changed event. We can show selected date in Label

<asp:Calendar ID="Calendar1" runat="server"

        onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar>

    <asp:Label ID="Label1" runat="server"></asp:Label>

 

protected void Calendar1_SelectionChanged(object sender, EventArgs e)

    {

        Label1.Text = Calendar1.SelectedDate.ToString();

    }

Calendar Control in ASP.Net

When you select the date then SelectionChanged event will fire and it will show the selected date and time in the Label.

Change Calendar Appearance

<asp:Calendar ID="Calendar1" runat="server" Font-Bold="True" Font-Italic="True" Font-Names="Arial Black" ForeColor="#FF6600" ></asp:Calendar>

 

Calendar Control in ASP.Net

Calendar Control in ASP.Net

Report Abuse Form
Reason:    
 

Title :
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
     
 
Latest Article by Pushpendra SinghRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 5105
Advertisement
MindStick Cleaner
Advertise with Us
  
Copyright © 2009 - 2014MindStick. All Rights Reserved.