Calendar Control
i have using calendar control i want to display selected particular date as red in color using c#(asp.net) with example.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 5, 2012, 2:57 AM EST
Try this...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Calender11._Default" %>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Drawing;
namespace Calender11
{
public partial class _Default : System.Web.UI.Page
{
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.IsToday)
{
e.Cell.BackColor = Color.Red;
//e.Cell.ForeColor = Color.Red;
}
}
}
}
Thanks
Posted Feb 5, 2012, 4:19 AM EST
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Calendar11._Default" %>
karthik v115 reputationPosted Feb 5, 2012, 5:17 AM EST
Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 5, 2012, 5:37 AM EST
Create your own app and add the code inside
Default.aspx.cs code
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.IsToday)
{
e.Cell.BackColor = Color.Red;
//e.Cell.ForeColor = Color.Red;
}
}
Thanks