任何人都可以告诉我如何用绿色和粉红色两种颜色突出显示c#日历日期我可以在日历单元格上应用div颜色吗?如果是,那么如何?目前我的代码是
if(dt.Rows.Count>1)
{
cell.BackColor = System.Drawing.Color.Yellow;
//cell.Style.Add("font-weight", "bold");
//cell.Style.Add("color", "pink");
//cell.ForeColor = System.Drawing.Color.Pink;
//foreach (var item in collection)
//{
//}
// cell.Controls.Add("divColor");
// cell.BackColor = System.Drawing.Color.Magenta;
}
if (dCalendarDate == tempDate)
{
ViewState["ManagerID"] = iManagerID;
//Session["tempid"] = iManagerID;
// int tempdate1 = iManagerID;
// if (tempid != iManagerID)
//{
// tblColorCodes clr = new tblColorCodes();
//clr.GetColor(tempid);
//}
DateTime tempdate2 = tempDate;
tblColorCodes objColorCode = new tblColorCodes();
objColorCode.GetColor(iManagerID);
string colorCode = objColorCode.ColorCode;
cell.BackColor = System.Drawing.Color.FromName(colorCode);
strJavascript = "javascript:datePic('" + day.Date + "','" + iManagerID + "');";
if (day.Date >= DateTime.Today)
{
cell.Attributes.Add("onclick", strJavascript);
}
}
}
cell.Style.Add("cursor", "pointer");
if (day.Date < DateTime.Now.Date)
{
cell.BackColor = System.Drawing.Color.FromArgb(150, 150, 150);
cell.ToolTip = "You can’t select a date in the past!";
}
//cell.Attributes.Add("onclick", "datePic('" + day.Date + "')");
}