Click here to Skip to main content
11,926,805 members (54,150 online)
Click here to Skip to main content
Add your own
alternative version


30 bookmarked

Anthem.PersianCalendar - .NET Persian Calendar WebControl

, 12 Nov 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
An Ajax PersianCalendar Control that looks like Original Calendar of .NET Framework



As you know, unfortunately there is no suitable Persian Calendar Control that can implement AJAX functionality. So I decided to solve the problem in the easiest way.
Thanks to Anthem Open Source AJAX toolkit, I used it to develop my new Calendar.


A .NET Calendar WebControl in fact is a Table Server Control. In each cell, there is a linkbutton control. So we can make our new Calendar with this Server Control. It’s easy to use and can fill some of our basic needs. One of these basic needs is Style. In a calendar, Styles of different parts are very important (e.g. the Style of Selected Date or Today or NextPrevMonthName and…).


In the new version of Persian Calendar, we have two events:

  • SelectedDayChange
  • SelectedMonthChange

You can handle these events to do any action on date change or month change.

Using the Code

It’s very easy to use. It looks just like original Calendar. It has some extra properties like FarsiDateType that formats the output string in the SelectedFarsiDate property. This property returns the Farsi date of SelectedDate Property.

protected void Button1_Click(object sender, EventArgs e)
this.ShowSelectedFarsiDate.Text = string.Format("{0}<p dir=rtl align=left>{1}</p>", 
this.ShowSelectedFarsiDate.UpdateAfterCallBack = true;

Points of Interest

During the development of this control, I was interested in Designer Attribute. I created a class that can handle AutoFormat Design-Time Service in this control. I hope this control can fit your needs too.


  • Version: 1.5.2 Of Anthem Ajax controls [With Events]
  • Version: 1.5.2 Of Anthem Ajax controls


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Morteza Alikhani
Software Developer
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionWorked wrong Pin
Member 635315513-Feb-14 7:16
memberMember 635315513-Feb-14 7:16 
Questionthanks Pin
Member 864468424-May-12 7:51
memberMember 864468424-May-12 7:51 
GeneralThx Pin
Kachal Khan18-Dec-11 21:31
memberKachal Khan18-Dec-11 21:31 
Questiontnx Pin
alireza_k_m23-Nov-11 20:43
memberalireza_k_m23-Nov-11 20:43 
GeneralMy vote of 5 Pin
NaDeRSetarei25-Sep-10 9:03
memberNaDeRSetarei25-Sep-10 9:03 
GeneralMy vote of 1 Pin
SinaPs115-Sep-09 19:09
memberSinaPs115-Sep-09 19:09 
GeneralRe: My vote of 1 Pin
Marc Leger12-Nov-09 12:45
memberMarc Leger12-Nov-09 12:45 
My vote of 1 on your 1 for mispelling explanation. Article is good.
GeneralGreat Project Pin
iranroshd.com5-Mar-08 22:17
memberiranroshd.com5-Mar-08 22:17 
GeneralGood Work Pin
Shoae5-Mar-08 18:44
memberShoae5-Mar-08 18:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.151126.1 | Last Updated 12 Nov 2009
Article Copyright 2008 by Morteza Alikhani
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid