Click here to Skip to main content
Click here to Skip to main content

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

Share

About the Author

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

Comments and Discussions

 
GeneralMy vote of 1 PinmemberSinaPs115-Sep-09 18:09 
GeneralRe: My vote of 1 PinmemberMarc Leger12-Nov-09 11:45 

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.

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