You must Sign In to post a response.
  • Category: ASP.NET

    How to Change Color for a Particular Date., The date which Stored on the Database

    Hi Developers,
    am creating a project.
    In my project Now i need to finish the following task.

    Admin Side (Doctor) :
    1. Select and insert Available date.
    2.The Admin Selected date is to be Stored on the database.

    User Side (Patient) :
    The user Can be able to Doctor's Available time.
    The Available(Admin Selected Dates) Date Box only Change to Green or any Colour.
    inside the Calendar.

    I get Confused to how to i going to done this task.

    So Guide to me for how to i finished this task Friends.

    Thanks With
  • #765352
    You can use calendar control, first you need to check with database and get stored date from database and make them disabled in calendar control and make there 'ForeColor' as 'RED' to denote as 'already blocked' dates
    see below snippet
    // We need this namespace
    using System.Drawing;

    public partial class DefaultCS : System.Web.UI.Page
    protected void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
    // Select all dates in the past
    if (e.Day.Date < System.DateTime.Today)
    // Disable date
    e.Day.IsSelectable = false;
    // Change color of disabled date
    e.Cell.ForeColor = Color.Gray;

    hope it helps

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765357
    Thanks for your quick reply Mr.Prasad .
    then Sorry i cant able to choose the best aswer. Because the link is not ishow here

    Thanking you

  • #765376
    Ok Mr.Prasad Manually you are Right. But How i am get the date from Database and how to change colour that particular Dates Only.

    Thanking you

  • Sign In to post your comments