Click here to Skip to main content
15,881,089 members
Articles / Web Development / ASP.NET

Anthem.PersianCalendar - .NET Persian Calendar WebControl

Rate me:
Please Sign up or sign in to vote.
4.65/5 (18 votes)
12 Nov 2009CPOL1 min read 76.4K   4.6K   29   11
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.

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


Written By
Software Developer Prodevelop.ir
Iran (Islamic Republic of) Iran (Islamic Republic of)
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionthanks Pin
Member 864468424-May-12 6:51
Member 864468424-May-12 6:51 

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.