Click here to Skip to main content
13,297,411 members (64,567 online)
Click here to Skip to main content
Add your own
alternative version


30 bookmarked
Posted 5 Mar 2008

Anthem.PersianCalendar - .NET Persian Calendar WebControl

, 12 Nov 2009
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 
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.

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