retricting dates on the ajaxToolkit:CalendarExtender control

Last post 09-02-2008 8:02 AM by TCavins. 2 replies.

Sort Posts:

  • retricting dates on the ajaxToolkit:CalendarExtender control

    08-31-2008, 4:38 PM
    • Member
      55 point Member
    • GianniP
    • Member since 08-06-2006, 7:42 PM
    • Posts 96

    Hi

     Is it possible to restrict the dates returned by the ajaxToolkit:CalendarExtender?

     I would like to only show October / November of the current year.

     

    thanks in advance.

  • Re: retricting dates on the ajaxToolkit:CalendarExtender control

    09-02-2008, 7:51 AM
    Answer

    Hi Giannip,

    As far as I know, this function is not supported now.  However, since it is an open source project we can modify its source code.  We suggest that you'd better go through the CalendarBehavior.js. The easier way is to use Javascript, validator or  server side logic to validate its selected date.  For example,

     <ajaxToolkit:CalendarExtender ID="CalendarExtender1" BehaviorID="myCEBID" runat="server" TargetControlID="TextBox1" Format="yyyy-MM-dd" PopupButtonID="Button1" OnClientDateSelectionChanged="onClientSelectDateChanged">
            </ajaxToolkit:CalendarExtender>

                function onClientSelectDateChanged(sender,args)
               {
                    //do the validate work here.
               } 

    Best regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: retricting dates on the ajaxToolkit:CalendarExtender control

    09-02-2008, 8:02 AM
    Answer
    • Member
      712 point Member
    • TCavins
    • Member since 05-23-2007, 10:06 AM
    • Detroit, MI
    • Posts 186

    Perhaps something along the lines of this. You'd have to play with it to limit it by month.

    http://codegoeshere.blogspot.com/2007/06/extending-calendarextender.html

    Tim

Page 1 of 1 (3 items)