Click here to Skip to main content
Licence CPOL
First Posted 2 Mar 2008
Views 23,687
Downloads 506
Bookmarked 36 times

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

By | 2 Mar 2008 | Article
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)

About the Author

vahid_mardani

Web Developer

Iran (Islamic Republic Of) Iran (Islamic Republic Of)

Member

Python, PostgreSQL, Cherrypy, Apache, .Net , C#, Asp.net, .Net Remoting, Ajax, Controls, MVC, SOA, SOAP, Razor

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalproblem with FireFox Pinmemberasedfred0:45 14 May '09  
QuestionDisplay Holidays PinmemberFateme Malek2:02 20 Sep '08  
AnswerRe: Display Holidays Pinmembervahid_mardani8:42 22 Sep '08  
General[Message Removed] PinmemberMojtaba Vali20:42 3 May '08  
GeneralThanks PinmemberMohebbi.Saeed5:30 25 Apr '08  
GeneralThanks PinmemberMember 25173025:08 25 Apr '08  
General[Message Removed] PinmemberMojtaba Vali19:59 4 Mar '08  
GeneralNew feature Pinmembermirshahreza19:50 3 Mar '08  
GeneralRe: New feature Pinmembervahid_mardani2:01 4 Mar '08  

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.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 2 Mar 2008
Article Copyright 2008 by vahid_mardani
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid