Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views1 page

Calendar

The document is a C# ASP.NET web page code for a calendar control. It includes functionalities to display the current date, a countdown to a vacation, and highlights a specific date (Teachers Day) with a custom label. The page also allows users to select a date and displays the selected date in a label.

Uploaded by

ssssooo1810
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Calendar

The document is a C# ASP.NET web page code for a calendar control. It includes functionalities to display the current date, a countdown to a vacation, and highlights a specific date (Teachers Day) with a custom label. The page also allows users to select a date and displays the selected date in a label.

Uploaded by

ssssooo1810
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

using System;

using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
public partial class calendarcontrol : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

protected void Button1_Click(object sender, EventArgs e)


{
Calendar1.Caption = "TY BSc Information Technology";
Calendar1.FirstDayOfWeek = FirstDayOfWeek.Sunday;
Calendar1.NextPrevFormat=NextPrevFormat.ShortMonth;
Calendar1.TitleFormat=TitleFormat.Month;
Label2.Text ="Todays Date:"+Calendar1.TodaysDate.ToShortDateString();

Label3.Text = "Ganpati Vacation Start:22-08-2025";


TimeSpan d = new DateTime(2025,8,22)-DateTime.Now;
Label4.Text = "Days Remaining For Ganpati Vacation:" + d.ToString();
}

protected void Calendar1_SelectionChanged(object sender, EventArgs e)


{
Label1.Text="Your Selected Date:" +
Calendar1.SelectedDate.Date.ToString();
}
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date.Day == 5 &&e.Day.Date.Month == 9)
{
e.Cell.BackColor = System.Drawing.Color.Blue;
Label lbl = new Label();
lbl.Text = "<br> Teachers Day!";
e.Cell.Controls.Add(lbl);
}

}
}
}

You might also like