AJAX CalendarExtender modification

Last post 11-10-2008 11:23 PM by Vince Xu - MSFT. 3 replies.

Sort Posts:

  • AJAX CalendarExtender modification

    11-03-2008, 1:54 PM
    • Member
      50 point Member
    • Beau_Damore
    • Member since 09-08-2007, 3:15 AM
    • Las Vegas
    • Posts 229

    Hello All,

    I want to limit the calendarextender views. I want the end-user to only be able to choose month/year no days.There's an articale for C# but I want to be able to set the CalendarExtender to have 3 modes in VB like this article shows. (Ive never modified the toolkit project, need to learn.)

    http://tonesdotnetblog.wordpress.com/category/calendarextender/

    Anyone know the conversion to VB? Thanks!

    Beau D'Amore
    Consultant
    www.beaudamore.com
  • Re: AJAX CalendarExtender modification

    11-04-2008, 10:46 PM
    Answer

    Hi,

    You can modify the original behavior.js to achieve it.

    Please go to CalendarBehavior.js in AjaxControlToolkit original project.  In _cell_onclick function, please use

                case "month":
                    if (target.month == visibleDate.getMonth()) {
                        this._switchMode("days");
                    } else {
                        this._visibleDate = target.date;
                        this.set_selectedDate(target.date);
                        this._switchMonth(target.date);
                        this._blur.post(true);
                        this.raiseDateSelectionChanged();
                    }
                    break;

    instead of

                case "month":
                    if (target.month == visibleDate.getMonth()) {
                        this._switchMode("days");
                    } else {
                        this._visibleDate = target.date;
                        this._switchMode("days");
                    }
                    break;

    And then please rebuild the project and add it as reference again. And you can use event "OnClientDateSelectionChanged" to define the value of TextBox after you choose the date from calendar.

    To convert C# to VB.Net, you can this tool: http://www.codechanger.com/

     


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: AJAX CalendarExtender modification

    11-07-2008, 1:28 PM
    • Member
      50 point Member
    • Beau_Damore
    • Member since 09-08-2007, 3:15 AM
    • Las Vegas
    • Posts 229

    Thank you very much. One question...Can I recompile this as another calendar? or can it only compile-over the original?

    And how do I recompile it at all?.. never done mods to the toolkit before.

    Beau D'Amore
    Consultant
    www.beaudamore.com
  • Re: AJAX CalendarExtender modification

    11-10-2008, 11:23 PM

    Hi,

    If you modify the original file, you need build it again and add the new dll as reference. This is the easiest way.

    You can also inherit the behavior to make a new Extender control.

     


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)