Click here to Skip to main content
Licence CPOL
First Posted 5 Mar 2008
Views 40,021
Downloads 2,005
Bookmarked 28 times

Anthem.PersianCalendar - .NET Persian Calendar WebControl

By | 12 Nov 2009 | Article
An Ajax PersianCalendar Control that looks like Original Calendar of .NET Framework
Anthem2005PlusPersianCalendar

PersianCalendarLogo.jpg

Introduction

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.

Background

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…).

Update

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.PersianCalendar1.SelectedDate.ToLongDateString(), 
	this.PersianCalendar1.SelectedFarsiDate);
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.

History

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

License

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
Prodevelop.ir
Iran (Islamic Republic Of) Iran (Islamic Republic Of)

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Questionthanks PinmemberMember 86446846:51 24 May '12  
GeneralThx PinmemberKachal Khan20:31 18 Dec '11  
Questiontnx Pinmemberalireza_k_m19:43 23 Nov '11  
GeneralMy vote of 5 PinmemberNaDeRSetarei8:03 25 Sep '10  
GeneralMy vote of 1 PinmemberSinaPs1118:09 5 Sep '09  
GeneralRe: My vote of 1 PinmemberMarc Leger11:45 12 Nov '09  
GeneralGreat Project Pinmemberiranroshd.com21:17 5 Mar '08  
GeneralGood Work PinmemberShoae17:44 5 Mar '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web03 | 2.5.120517.1 | Last Updated 12 Nov 2009
Article Copyright 2008 by Morteza Alikhani
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid