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. disable future dates in calendar extender control

disable future dates in calendar extender control

Scheduled Pinned Locked Moved ASP.NET
question
4 Posts 3 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.
  • K Offline
    K Offline
    keyur satyadev
    wrote on last edited by
    #1

    Hi Freinds I am using CalendarExtendar Control of AjaxControlToolKit. now i need to disable all dates which is greater then today's date. is this possible? if yes let me know. please reply if u have other way to hide future date in calendar control thanks Regards Keyur Satyadev

    L 1 Reply Last reply
    0
    • K keyur satyadev

      Hi Freinds I am using CalendarExtendar Control of AjaxControlToolKit. now i need to disable all dates which is greater then today's date. is this possible? if yes let me know. please reply if u have other way to hide future date in calendar control thanks Regards Keyur Satyadev

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hope this will help you <pre> <head runat="server">       <title>Calendar Extender</title>       <script type="text/javascript">       function checkDate(sender,args) { if (sender._selectedDate > new Date())                   {                         alert("You cannot select a day greater than today!");                         sender._selectedDate = new Date();                         // set the date back to the current date sender._textbox.set_Value(sender._selectedDate.format(sender._format))                   } }       </script> </head> Call the code:    <form id="form1" runat="server">             <asp:ScriptManager ID="ScriptManager1" runat="server" />             <div>                                  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>                   <cc1:CalendarExtender ID="CalendarExtender1"                   runat="server" OnClientDateSelectionChanged="checkDate" TargetControlID="TextBox1" />             </div>       </form> </pre>

      K 1 Reply Last reply
      0
      • L Lost User

        Hope this will help you <pre> <head runat="server">       <title>Calendar Extender</title>       <script type="text/javascript">       function checkDate(sender,args) { if (sender._selectedDate > new Date())                   {                         alert("You cannot select a day greater than today!");                         sender._selectedDate = new Date();                         // set the date back to the current date sender._textbox.set_Value(sender._selectedDate.format(sender._format))                   } }       </script> </head> Call the code:    <form id="form1" runat="server">             <asp:ScriptManager ID="ScriptManager1" runat="server" />             <div>                                  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>                   <cc1:CalendarExtender ID="CalendarExtender1"                   runat="server" OnClientDateSelectionChanged="checkDate" TargetControlID="TextBox1" />             </div>       </form> </pre>

        K Offline
        K Offline
        keyur satyadev
        wrote on last edited by
        #3

        Thanks for Reply.

        F 1 Reply Last reply
        0
        • K keyur satyadev

          Thanks for Reply.

          F Offline
          F Offline
          Fahad_ADO
          wrote on last edited by
          #4

          it is not working , what parameters do i give whole calling the java script function in the extender control : for the check Date Function what Arguments do I give while calling , as my java script function is not letting the calendar control work . function checkDate(sender, args) { alert('WHAT'); if (sender._selectedDate <; new Date()) { alert("You cannot select a day earlier than today!"); sender._selectedDate = new Date(); // set the date back to the current date sender._textbox.set_Value(sender._selectedDate.format(sender._format)) } }

          Fad .

          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