Satyapriya Nayak
posted
2264 posts
since
Mar 24, 2010
from
|
|
Re: Calendar Control
|
|
|
|
|
|
|
|
|
|
|
Hi narasiman,
Try this...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Calender11._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Calendar ID="Calendar1" runat="server" ondayrender="Calendar1_DayRender"></asp:Calendar> </div> </form> </body> </html>
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
|
|
|
|
|
|
narasiman man
posted
65 posts
since
Dec 22, 2011
from
|
|
Re: Calendar Control
|
|
|
|
|
|
|
|
|
|
|
Hi my dear friend i got it ur code and work it out while execute your code it will show Could not load type 'Calendar11._Default'. that error help <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Calendar11._Default" %>
|
|
|
|
|
|
karthik vasudevula
posted
64 posts
since
Feb 16, 2011
from
|
|
Re: Calendar Control
|
|
|
|
|
|
|
|
|
|
|
Remove the Calender11 from the inherits and set it to Inherits=_Default
|
|
|
|
|
|
Satyapriya Nayak
posted
2264 posts
since
Mar 24, 2010
from
|
|
Re: Calendar Control
|
|
|
|
|
|
|
|
|
|
|
Hi Narasiman,
Create your own app and add the code inside <div></div> tags as below.
<div> <asp:Calendar ID="Calendar1" runat="server" ondayrender="Calendar1_DayRender"></asp:Calendar> </div>
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
|
|
|
|
|
|