Tuesday, August 19, 2008 1:53 PM rrobbins

How To Add A New Property To The AJAX Calendar Control

I've finally gotten around to using something from the AJAX Control Toolkit in an actual project. My client was dissatisfied with the <asp:calendar> control so I offered to AJAX enable the site and replace it with the fancier Calendar control from the ASP.NET AJAX Control Toolkit. Naturally the client found something he wanted to work a little different. This calendar control was for entering your birth date and he did not want the user to scroll back decades to find that date. He wanted the calendar to show up with the 1990-1999 decade already visible so the user could start from there. Fortunately I remembered that the ASP.NET AJAX Control Toolkit comes with all the source code so you can customize it to suite your needs.

This requirement was extremely easy to implement. All you really need to do is set the calendar mode to "years" when you first show it. However there was no property for initial mode so I had to create one. This was virtually a cut and paste hack because there are existing properties to base it on.

1. Open CalendarExtender.cs and create a new ExtenderControlProperty:

   1: [DefaultValue("")]
   2: [ExtenderControlProperty]
   3: [ClientPropertyName("initialMode")]
   4: public virtual string InitialMode
   5: {
   6:    get { return GetPropertyValue("InitialMode", string.Empty); }
   7:    set { SetPropertyValue("InitialMode", value); }
   8: }

2. Open CalendarBehavior.js and create a new member:

   1: this._initialMode = null;

3. Also in CalendarBehavior.js add new get and set functions for the property access:

   1: get_initialMode : function() { 
   2:     /// <value type="String">
   3:     /// The initial mode of the calendar
   4:     /// </value>
   5:  
   6:     return this._initialMode; 
   7: },
   8: set_initialMode : function(value) { 
   9:     if (this._initialMode != value) {
  10:         this._initialMode = value; 
  11:         this.raisePropertyChanged("initialMode");
  12:     }
  13: }, 

4. And finally set the _switchMode in the show : function() with this new line of code:

   1: this._switchMode(this._initialMode, true);

Compile the AjaxControlToolkit project and copy the AjaxControlToolkit.dll file to your bin directory. Now you can use your new property in the Calendar control like so:

   1: <ajaxToolkit:CalendarExtender ID="calendarButtonExtender" runat="server" TargetControlID="Date5" 
   2:             PopupButtonID="Image1" InitialMode="years" />
Calendar-Years-Mode[4] Filed under: ,

Comments

# re: How To Add A New Property To The AJAX Calendar Control

Monday, November 17, 2008 2:06 PM by kk18_b

can you please tell me whether we can any property where it just displays the months instead of dates. I mean, I dont want to display the dates in my ajax calendar control.

# re: How To Add A New Property To The AJAX Calendar Control

Monday, March 02, 2009 11:54 PM by HsvsRsvsesv

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, December 23, 2010 4:21 AM by Joan Doyle

fail???

My Regards

<a href="http://alternativemedicine.org.in">alternative medicine course</a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, December 23, 2010 10:31 PM by Isabelle Cote

Hey , lol =D

Best regards

<a href="alternativemedicinecourse.com/.../naturopathy-courses">naturopathy courses in India</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, December 24, 2010 9:28 PM by Tristan

I have to hear exactly what  thinks about that.

-Warm regards

<a href="http://www.SecurityCubed.com">security systems for home</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, December 25, 2010 4:45 AM by Dee

I am very pleased you said this post!!

<a href="http://www.findgroomers.com">dog grooming</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, December 25, 2010 10:46 PM by Morgan

Hey , lol?!?

<a href="http://alternativemedicine.org.in">alternative medicine college</a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, December 26, 2010 6:27 PM by Cornelius Vang

ftw??

<a href="www.live-girls-webcam-chat.com/">chat dresden</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, December 27, 2010 8:37 PM by Natasha

Could be the most influential thing that I have read all month..

<a href="www.netezines.net/secrets-of-successful-traders-review">secrets of successful traders review</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, December 28, 2010 9:01 PM by Rae

rocks!

<a href="www.cigars-now.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, December 29, 2010 5:56 PM by Reyna Cline

Great post, been after that?!?

<a href="www.live-couples-webcam-chat.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, December 30, 2010 8:21 AM by Jarvis Carson

, whatever dude!!

<a href="http://webreputationmanagement.info">Click Here To View My Site</a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, December 30, 2010 7:17 PM by Coleen

, WTF???

<a href="http://www.SecurityCubed.com">alarm systems for the home</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, December 31, 2010 7:43 PM by Reba

Great post! You might want to follow up on this topic :D

<a href="www.cigars-now.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, January 01, 2011 5:47 PM by Randolph Quigley

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, January 02, 2011 7:03 PM by Abdul

I am curious  what Rachael thinks about this?

<a href="www.netezines.net/joseph-matthews-the-art-of-approaching-review">the art of approaching</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, January 03, 2011 10:20 AM by Anna Lanier

Rosemary is the greatest!!!

<a href="http://www.findgroomers.com">dog grooming</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, January 04, 2011 7:39 PM by Guadalupe Kowalski

Zane ROCKS?

Max

<a href="www.cigars-now.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, January 05, 2011 9:10 PM by Iris

Herschel, I don't think so!

<a href="www.erotiklobby.com/">geli harry fototausch</a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, January 06, 2011 9:54 PM by Virginia Dawson

Possibly the top paper that I have read all week..

<a href="alternativemedicine.org.in/acupressure.html">acupressure courses in India</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, January 08, 2011 9:35 PM by Brain Dillon

Hey Gilberto, WTF!

<a href="alternativemedicine.org.in/acupressure.html">acupressure courses</a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, January 09, 2011 3:44 PM by Sonia

Possibly the best read that I read all month??

-My regards

Patsy

<a href="fickmaschine-live.com/">live fickmaschine</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, January 10, 2011 7:48 PM by Yvonne Do

This is the top page that I have read all year!?!

Kindest Regards

Jessie

<a href="www.ipcounter.net/">html counter code</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, January 11, 2011 10:13 PM by Rosanna Stubbs

I have to hear  what Juliana will change about that!!

-Sincerest Regards,

Alfreda

<a href="http://webreputationmanagement.info">corporate reputation management</a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, January 13, 2011 12:39 AM by Larry

Dewayne, wtf!?!

<a href="www.netezines.net/boilx-review">boilx review</a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, January 13, 2011 10:33 PM by Genevieve Burgess

Bridgette, yea right?!?

Fondest Regards

Hal

<a href="http://www.cigars-now.com">cigar</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, January 15, 2011 12:01 AM by Lynne

I am glad you said that!!

Warm Regards,

Shirley

<a href="www.cigars-now.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, January 15, 2011 10:33 PM by Carmen Sandoval

I am wondering exactly what Rae will change about this..

<a href="www.oregonlngpropertysearch.com/">moncler jacket</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, January 17, 2011 11:17 PM by Andrea Ly

Great blog post, I've been looking for that :)

<a href="http://www.asparagus-soap.com">Natural Soap</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, January 18, 2011 3:36 PM by Bobbi

I'm glad you said that!!!

<a href="www.parketarstvo-cerkvenik.si/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, January 20, 2011 3:48 AM by Angeline Mcgrath

Rhea rocks!?!

<a href="ezinearticles.com berry diet pills</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, January 21, 2011 1:34 AM by Elsie Cuevas

Isabelle is the best?!

Homer

<a href="http://www.gume-oblak.si">gume</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, January 22, 2011 5:58 AM by Milagros Mccoy

Alex, whatever man!

<a href="http://alternativemedicinecourse.com">alternative medicine</a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, January 23, 2011 1:45 AM by Jennifer Torres

I need to know just what Tanner has to say about this :D

Eldon

<a href="www.gbbilder4you.com/">kostenlose gb bilder für jappy</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, January 24, 2011 3:52 AM by Johnnie

I'm very glad that you said that post!

Brittany

<a href="www.gbbilder4you.com/">lustig gb pics</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, January 24, 2011 11:23 PM by Susan

Great read! You may want to follow up to this topic!?

<a href="http://webreputationmanagement.info">brand reputation management</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, January 25, 2011 11:59 PM by Grace Vaughan

Great writing! I wish you could follow up to this topic?

<a href="mizarstvo-jereb.si/.../">previjalna miza</a>

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, January 26, 2011 9:42 PM by Susana Tobin

I'm happy that you said this post??

<a href="www.nacht-creme.net/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, January 27, 2011 11:57 PM by Erich Dietz

This is the BEST blog I have read in my life :D

<a href="www.oregonlngpropertysearch.com/">moncler jacket</a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, January 30, 2011 11:26 PM by Garrett

This is the GREATEST page that I read this week!!!

-Yours truly

Casandra

<a href="http://www.cigars-now.com">cigars</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, February 01, 2011 2:50 AM by Mohamed

Great writing! Maybe you could do a follow up to this topic!!

<a href="www.cigars-now.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, February 02, 2011 4:35 AM by Jess Padilla

I'm very thrilled you said that?!?

<a href="www.lida-schlankheitskapseln.com/">lida di�tpillen</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, February 04, 2011 12:46 AM by Antone

Kitty rocks :P

<a href="www.butikonlinemurah.com/">Butik Online Murah</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, February 04, 2011 11:29 PM by Edwin Frye

Clara ROCKS...

Noreen

<a href="http://www.findgroomers.com">dog grooming</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, February 05, 2011 9:12 PM by Scot

Marcelo is the greatest?!?

<a href="www.sumobulldogs.com/">AKC champion English bulldog stud service</a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, February 06, 2011 11:58 AM by Ed Watson

Great post! You should definitely follow up to this topic!!

<a href="www.camchatladies.com/">rtl chat</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, February 08, 2011 9:22 PM by Henrietta Mathews

Great blog post, I have been after that!?

<a href="www.asparagus-soap.com/.../scrubs.html">Oatmeal scrubs</a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, February 10, 2011 11:32 PM by Lou

The best blog that I read all week!!

Barney

<a href="www.butikonlinemurah.com/">Butik Online Murah</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, February 11, 2011 9:15 PM by Barney

I am glad you said that?!?

<a href="www.netezines.net/penny-stock-prophet-review">penny stock prophet review</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, February 14, 2011 1:30 AM by Carmine Mcwilliams

Great post! Maybe you could do a follow up on this topic...

<a href="www.oregonlngpropertysearch.com/">moncler jacket</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, February 15, 2011 5:49 AM by Leland Benjamin

I'm glad you said that...

Pedro

<a href="www.oregonlngpropertysearch.com/">moncler jackets</a>

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, February 16, 2011 1:53 AM by Antoinette

Orlando, yea right!?!

-Kind Regards

Newton

<a href="www.mystogie.com/.../gurkha-cigars.html">gurkha cigars</a>

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, February 16, 2011 11:35 PM by Maritza Koch

I have to hear just what Bob can do with that??

Gene

<a href="www.was-frauen-wollen.com/">schlechtes sperma</a>

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, February 17, 2011 10:32 AM by Rusty

I have to hear exactly what Morton has to say about that!

<a href="http://www.zlatorogi.si">ansambel</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, February 18, 2011 3:48 AM by Chris Elder

Heather is the greatest :P

<a href="http://popcornshows.com">streaming</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, February 19, 2011 2:21 AM by Ofelia

Letha FAIL =D

Kind regards,

Karl

<a href="http://www.latest-tv.com">streaming movies</a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, February 20, 2011 12:33 AM by Bryan

Great post, been looking for that!!

Angelia

<a href="freiepotenzmittel.com/">rezept medikamente kaufen</a>

# Fickmaschine iris | Brooza

Monday, July 25, 2011 7:28 PM by Fickmaschine iris | Brooza

Pingback from  Fickmaschine iris | Brooza

# re: How To Add A New Property To The AJAX Calendar Control

Friday, April 20, 2012 5:06 AM by TheronAI

Cheap Celine supplied in best quality. All latest style Celine bag discount on sale on line. Welcome to shopping discount celine handbags back home from Our Celinie UK Store.

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, September 19, 2012 8:53 PM by icons library

 I am sorry, that has interfered... I understand this question. Let's discuss. Write here or in PM.

P.S. Please review <a href="martinking33.deviantart.com/.../Blue-Icon-Library-312330289">Blue Icon Library from martinking33</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, September 21, 2012 3:40 PM by icon library

P.S. Please review <a href="designesticons.deviantart.com/.../Android-Status-Bar-Icons-280269826">Android Status Bar Icons from designesticons</a>

# re: How To Add A New Property To The AJAX Calendar Control

Friday, September 21, 2012 10:02 PM by icon collection

 Interesting theme, I will take part. I know, that together we can come to a right answer.

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, September 22, 2012 5:02 PM by icon download

 Where you so for a long time were gone?

<a href="www.hpixel.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, September 23, 2012 1:25 AM by icons pack

 Completely I share your opinion. It seems to me it is good idea. I agree with you.

<a href="www.hpixel.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, September 24, 2012 8:11 AM by icons downloads

 I can suggest to come on a site where there are many articles on a theme interesting you.

<a href="www.hpixel.com/.../a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, October 08, 2012 11:10 AM by icon download

<a href="www.beemylink.de/.../clipart"> Very useful message</a>

# re: How To Add A New Property To The AJAX Calendar Control

Monday, October 08, 2012 8:56 PM by icons download

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, October 09, 2012 8:46 AM by icon designs

<a href="www.large-icons.com/.../home.htm"> Bravo, what necessary words..., a brilliant idea</a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, October 09, 2012 11:03 PM by icons downloads

<a href="www.download-web.de/.../30153.html"> Excuse, the message is removed</a>

# re: How To Add A New Property To The AJAX Calendar Control

Saturday, October 20, 2012 1:50 PM by reorcerak

TwellaJep  <a href=>coach factory outlet online</a>

TotInsuts  <a href=>coach factory online</a>

guethighsiz  <a href=>coach factory online</a>

Audisrurn  <a href=>coach outlet online</a>

Audisrurn  

# re: How To Add A New Property To The AJAX Calendar Control

Monday, October 22, 2012 3:07 PM by Jimmyyc1wp

ovwlc<a href=> troy polamalu jersey </a>

wacbz<a href=> jarret johnson jersey </a>

vqvat<a href=> sam bradford jersey </a>

pxxrh<a href=> eric decker jersey </a>

jguit<a href=> andrew luck jersey </a>

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, October 23, 2012 11:28 AM by Jimmyvo8em

llsna<a href=> andy dalton jersey </a>

nhjyc<a href=> jason witten jersey </a>

hvswg<a href=> dallas clark jersey </a>

ihwgm<a href=> danny woodhead jersey </a>

eywpm<a href=> drew brees jersey </a>

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, October 31, 2012 11:58 AM by icons pack

 In my opinion you are not right. I can defend the position. Write to me in PM.

<a href="windows2012icons.com/.../dll-iconfiles-71">dll iconfiles</a>

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, November 04, 2012 7:47 AM by icon pack

[url=courses.papagiannakis.org/viewtopic.php] I congratulate, it seems remarkable idea to me is[/url]

# re: How To Add A New Property To The AJAX Calendar Control

Sunday, November 04, 2012 8:20 AM by icons package

[url=dingdong-dingdong2.gforen.de/viewtopic.php] Thanks for the help in this question. I did not know it.[/url]

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, December 12, 2012 11:40 PM by download icons

P.S. Please review our <a href="http://sv.glossyblog.info">design portfolio</a> for Doors2012.

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, December 13, 2012 2:34 AM by icon

P.S. Please review our <a href="http://ipad.militarydesign.biz">design portfolio</a> for Doors2012.

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, December 13, 2012 11:10 PM by windows icons

P.S. Please review our <a href="http://ru.devcourse.com">design portfolio</a> for Doors2012.

How To Select a Provider for Customer Service Training

Good training is necessary to develop a culture of outstanding customer service within an organization. Care should be taken in choosing the training program that will best meet the needs of the organization. The size of a company is important to keep in mind when deciding on a training program to use. While it should not be neglected in any businwss, in certain industries, customer service has more priority than in other industries. The length of the training will also be determined by teh employees' position within the company. What are the two biggest keys to keep in mind when choosing a training program?Choose a Company With ExperienceAuthor Clarence Day once said, "Information's pretty thin stuff unless mixed with experience." In the professional training world experience equates to a continuous record of success. Over the years best strategies for caring for customers' needs can change, and a good training provider will evolve with the times. Experience also means the ability to work with a variety of different kinds of organizationns. An experienced training provider will establish the biggest needs of the business and then tailor a program to meet those needs. They will also stand by their methods because they have been established as being successful.Choose a Creative CompanyProviding for customers' needs in the most effective way possible requires some creative thinking. Setting yourself apart from the competition requires making customers feel special. This sometumes requires a novel approach to certain customer service issues. Specific customer issues, which arise on a regular basis, may require approaching the training provider about this specific problem. The training provider can then brainstorm possible solutions and the solutions can be presented to employees during the training program. Technology has opened a whole new world of creative ways to provide exceptional customer service; a creative training provider will also make use of these options.Any training you undertake is an investment, and to get the most from that investment it is essential to choose the right customer service training provider. Do research before making a decision. An experienced customer service training provider will provide plenty of information related to their experience in the field. Keeping in mind the importance of the two big principles outlined above will allow for the selection of a dynamic training provider that can bring an outstanding customer service attitude into the organization.

# re: How To Add A New Property To The AJAX Calendar Control

Thursday, April 04, 2013 1:42 PM by Mcdaniels

I don't create a ton of responses, however I glanced through a few responses on How To Add A New Property To The AJAX Calendar Control - Robert Robbins. I actually do have some questions for you if it's allright.

Could it be simply me or do some of the comments appear

as if they are written by brain dead individuals?

:-P And, if you are posting on other places, I'd like to keep up with anything new you have to post. Could you post a list of all of all your social community sites like your Facebook page, twitter feed, or linkedin profile?

# re: How To Add A New Property To The AJAX Calendar Control

Wednesday, April 10, 2013 2:27 PM by lrcftjs@gmail.com

Other countries censor content and not just rogue regimes such as the Iranian mullocracy. Poor people!  http://www.baidu.com

# re: How To Add A New Property To The AJAX Calendar Control

Tuesday, April 16, 2013 8:04 PM by Knapp

You're so interesting! I don't suppose I have read through something like that before.

So great to find another person with genuine thoughts on this subject.

Really.. many thanks for starting this up. This site is

one thing that is required on the web, someone with some originality!

Leave a Comment

(required) 
(required) 
(optional)
(required)