Click here to Skip to main content
13,294,516 members (58,326 online)
Click here to Skip to main content
Add your own
alternative version


38 bookmarked
Posted 2 Mar 2008

An ASP.NET control to pick a Shamsi date on client-side from a JavaScript Persian calendar

, 2 Mar 2008
Rate this:
Please Sign up or sign in to vote.
This an ASP.NET server-side control that wraps Mr Amin Habibi's JavaScript calendar.



This is a simple ASP.NET control that can be used for easily picking a Shamsi date. You only have to add this control to the Toolbox and drag it into your page, or register the assembly with the <@Register page directive.

Base idea

See this link for the previous version of this idea implemented in client-side JavaScript, from Amin Habibi:

Using sample

Registering the assembly:

<%@ Register Assembly="AspNetPersianDatePickup" 

    Namespace="AspNetPersianDatePickup" TagPrefix="pcal" %> 

Using the control:

<pcal:PersianDatePickup ID="PersianDatePickup1" 



The calendar's JavaScript file is embedded in the assembly resource, and it serves the clients with the "ASP.NET WebResource" technology. I used this for stylesheets and images as well.

Points of interest

In the server side, you can use the Text property for retrieving the Christian datetime in string format. If you need the control's value as a DateTime data type, you can use or bind the SelectedDateTime property. You may use the PersianDateString property for retrieving the Shamsi date as a string.

Good luck and a special thanks to "Mr. Amin Habibi".


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


About the Author

Web Developer
Iran (Islamic Republic of) Iran (Islamic Republic of)
Python, PostgreSQL, Cherrypy, Apache, .Net , C#,, .Net Remoting, Ajax, Controls, MVC, SOA, SOAP, Razor

You may also be interested in...


Comments and Discussions

GeneralNew feature Pin
mirshahreza3-Mar-08 20:50
membermirshahreza3-Mar-08 20:50 
GeneralRe: New feature Pin
vahid_mardani4-Mar-08 3:01
membervahid_mardani4-Mar-08 3:01 

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
Web03 | 2.8.171207.1 | Last Updated 2 Mar 2008
Article Copyright 2008 by vahid_mardani
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid