Click here to Skip to main content
11,478,873 members (67,354 online)
Click here to Skip to main content

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

, 2 Mar 2008 CPOL 37.5K 1.5K 38
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.

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:

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

Using the control:

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

Share

About the Author

vahid_mardani
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

 
GeneralMy vote of 2 Pin
Jahan Alem26-Apr-13 19:59
memberJahan Alem26-Apr-13 19:59 
Questionproblem in iis7 Pin
sara_432117-Dec-12 20:01
membersara_432117-Dec-12 20:01 
AnswerRe: problem in iis7 Pin
vahid_mardani18-Dec-12 5:09
membervahid_mardani18-Dec-12 5:09 
Questionproblem with firefox Pin
Mary_m3-Jul-12 22:31
memberMary_m3-Jul-12 22:31 
AnswerRe: problem with firefox Pin
M_Tajvari9-Dec-12 21:56
memberM_Tajvari9-Dec-12 21:56 
GeneralRe: problem with firefox Pin
vahid_mardani10-Dec-12 8:10
membervahid_mardani10-Dec-12 8:10 
Questionunable to find dll Pin
TayebehBagheri20-Jun-12 2:40
memberTayebehBagheri20-Jun-12 2:40 
AnswerRe: unable to find dll Pin
vahid_mardani20-Jun-12 3:20
membervahid_mardani20-Jun-12 3:20 
Generalproblem with FireFox Pin
asedfred14-May-09 1:45
memberasedfred14-May-09 1:45 
QuestionDisplay Holidays Pin
Fateme Malek20-Sep-08 3:02
memberFateme Malek20-Sep-08 3:02 
hi dear vahid,
thanks for ur component. it's very usefull. but i want that my calendar specified holidays. i use this code but i dont know how can access to it's cell?

cell.BackColor = System.Drawing.Color.HotPink;
cell.Controls.Add(new LiteralControl("<BR>" + holidayStr));

AnswerRe: Display Holidays Pin
vahid_mardani22-Sep-08 9:42
membervahid_mardani22-Sep-08 9:42 
General[Message Removed] Pin
Mojtaba Vali3-May-08 21:42
memberMojtaba Vali3-May-08 21:42 
GeneralThanks Pin
Mohebbi.Saeed25-Apr-08 6:30
memberMohebbi.Saeed25-Apr-08 6:30 
GeneralThanks Pin
Member 251730225-Apr-08 6:08
memberMember 251730225-Apr-08 6:08 
General[Message Removed] Pin
Mojtaba Vali4-Mar-08 20:59
memberMojtaba Vali4-Mar-08 20:59 
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    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 | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 2 Mar 2008
Article Copyright 2008 by vahid_mardani
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid