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);
}
}
}
}