Click here to Skip to main content
15,868,016 members
Articles / Web Development / HTML

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

Rate me:
Please Sign up or sign in to vote.
4.71/5 (25 votes)
2 Mar 2008CPOL 58.4K   1.8K   38   18
This an ASP.NET server-side control that wraps Mr Amin Habibi's JavaScript calendar.

ScreenShot.JPG

Introduction

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: http://www.codeproject.com/KB/scripting/Persian_Date_Picker.aspx.

Using sample

Registering the assembly:

ASP.NET
<%@ Register Assembly="AspNetPersianDatePickup" 
    Namespace="AspNetPersianDatePickup" TagPrefix="pcal" %> 

Using the control:

ASP.NET
<pcal:PersianDatePickup ID="PersianDatePickup1" 
       runat="server"></pcal:PersianDatePickup> 

Background

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".

License

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


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

Comments and Discussions

 
Questionadding custom control to content pages Pin
Member 116628374-Dec-15 23:23
Member 116628374-Dec-15 23:23 
GeneralMy vote of 2 Pin
Jahan Alem26-Apr-13 18:59
Jahan Alem26-Apr-13 18:59 
Questionproblem in iis7 Pin
sara_432117-Dec-12 19:01
sara_432117-Dec-12 19:01 
AnswerRe: problem in iis7 Pin
vahid_mardani18-Dec-12 4:09
vahid_mardani18-Dec-12 4:09 
Questionproblem with firefox Pin
Mary_m3-Jul-12 21:31
Mary_m3-Jul-12 21:31 
AnswerRe: problem with firefox Pin
M_Tajvari9-Dec-12 20:56
M_Tajvari9-Dec-12 20:56 
GeneralRe: problem with firefox Pin
vahid_mardani10-Dec-12 7:10
vahid_mardani10-Dec-12 7:10 
Questionunable to find dll Pin
TayebehBagheri20-Jun-12 1:40
TayebehBagheri20-Jun-12 1:40 
AnswerRe: unable to find dll Pin
vahid_mardani20-Jun-12 2:20
vahid_mardani20-Jun-12 2:20 
Generalproblem with FireFox Pin
asedfred14-May-09 0:45
asedfred14-May-09 0:45 
QuestionDisplay Holidays Pin
Fateme Malek20-Sep-08 2:02
Fateme Malek20-Sep-08 2:02 
AnswerRe: Display Holidays Pin
vahid_mardani22-Sep-08 8:42
vahid_mardani22-Sep-08 8:42 
hi dear fatemeh.i cannot help you, because i was leaved asp.net,asp.net has chipest way to programming web applications.i was leaved Micro$oft. please research about python & switch to it.
asp.net : too slow!!
asp.net : too unsecure!!
asp.net have very bug!!
asp.net is amateurs choice!!

success is in python or anythings else asp.net!!!

Vahid Mardani(KingOf.Net)

General[Message Removed] Pin
Mojtaba Vali3-May-08 20:42
Mojtaba Vali3-May-08 20:42 
GeneralThanks Pin
Mohebbi.Saeed25-Apr-08 5:30
Mohebbi.Saeed25-Apr-08 5:30 
GeneralThanks Pin
Mohebbi.Saeed25-Apr-08 5:08
Mohebbi.Saeed25-Apr-08 5:08 
General[Message Removed] Pin
Mojtaba Vali4-Mar-08 19:59
Mojtaba Vali4-Mar-08 19:59 
GeneralNew feature Pin
mirshahreza3-Mar-08 19:50
mirshahreza3-Mar-08 19:50 
GeneralRe: New feature Pin
vahid_mardani4-Mar-08 2:01
vahid_mardani4-Mar-08 2: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.