Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. booked dates should appear in red color in calender

booked dates should appear in red color in calender

Scheduled Pinned Locked Moved ASP.NET
graphicshelplearning
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 8664010
    wrote on last edited by
    #1

    i am disabling past dates and remaining dates in green color with the following code

    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {if (e.Day.Date < DateTime.Today)
    {

            e.Day.IsSelectable = false;e.Cell.ForeColor = System.Drawing.Color.Gray;
       }
       else
       {
           e.Cell.ForeColor = System.Drawing.Color.Green;
       } }
    

    i have two dropdownlists ddlFrom and ddlTo.i vil select dates from these dropdownlists to book a room in a hotel.the dates fromdate to todate should appear in red color...any help is appreciated

    S 1 Reply Last reply
    0
    • U User 8664010

      i am disabling past dates and remaining dates in green color with the following code

      protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
      {if (e.Day.Date < DateTime.Today)
      {

              e.Day.IsSelectable = false;e.Cell.ForeColor = System.Drawing.Color.Gray;
         }
         else
         {
             e.Cell.ForeColor = System.Drawing.Color.Green;
         } }
      

      i have two dropdownlists ddlFrom and ddlTo.i vil select dates from these dropdownlists to book a room in a hotel.the dates fromdate to todate should appear in red color...any help is appreciated

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      Member 8701813 wrote:

      .any help is appreciated

      Can you be specific on what kind of help you seek? You shared the colors of dates in a calendar, next you talk of having start-end date in red color, what does it mean? What exactly are you trying to do? Where are you stuck specifically when you tried?

      Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

      U 2 Replies Last reply
      0
      • S Sandeep Mewara

        Member 8701813 wrote:

        .any help is appreciated

        Can you be specific on what kind of help you seek? You shared the colors of dates in a calendar, next you talk of having start-end date in red color, what does it mean? What exactly are you trying to do? Where are you stuck specifically when you tried?

        Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

        U Offline
        U Offline
        User 8664010
        wrote on last edited by
        #3

        i mean , i vil select dates from dropdown lists namely ddlfrom and ddlto dropdownlists to book a room in hotel.in a calender these dates which are selected from the above mentioned dropdownlists should appear in red color...which indicates those dates are booked....available dates are in green color...only dates which are in green color the user can book....red colored dates he cannot book...i tried this in selection_changed event ...but i couldn't meet this requirement...

        1 Reply Last reply
        0
        • S Sandeep Mewara

          Member 8701813 wrote:

          .any help is appreciated

          Can you be specific on what kind of help you seek? You shared the colors of dates in a calendar, next you talk of having start-end date in red color, what does it mean? What exactly are you trying to do? Where are you stuck specifically when you tried?

          Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

          U Offline
          U Offline
          User 8664010
          wrote on last edited by
          #4

          hi,my requirement is changed now...i have to use 2 textboxes namely txtFrom and txtTo.i vil enter dates in these 2 textboxes..the dates mentioned from txtFrom to txtTo shuld appear in red color.i am converting string to date by the following code DateTime FromDate = DateTime.ParseExact(txtFrom.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); DateTime ToDate = DateTime.ParseExact(txtTo.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); but how to implement in calender...pls give me any suggestion...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups