Click here to Skip to main content
12,819,248 members (29,817 online)
Click here to Skip to main content
Add your own
alternative version

Stats

74.1K views
1.9K downloads
33 bookmarked
Posted 6 Sep 2005

JSCalendar Custom Control for Visual Studio .NET

, 2 Oct 2005 CPOL
Rate this:
Please Sign up or sign in to vote.
Creating a custom control for JSCalendar.

Sample Image - jscalendar.jpg

Introduction

JSCalendar is one of the powerful JavaScript calendars, you can download it from http://sourceforge.net/projects/jscalendar/.

JSCalendar can be used to add to date input fields a button that lets the user choose a date using a pop-up calendar. The control will allow you to add this calendar to your ASP.NET pages without configuring the JavaScript code.

How to use the control

  1. Download the file DLL.Zip
  2. Unzip the file to Calendar.dll
  3. Open Visual Studio .NET
  4. Right click on the toolbox then click Add/Remove Item
  5. From the Customize Tool Box window, click Browse, and select the DLL file (Calendar.Dll)
  6. The control will be added to your toolbox:
  7. Sample Image - jscalendar.jpg

  8. Create a new ASP.NET project, then drag and drop the calendar control to your form.
  9. From the Properties window you can set the path of the scripts file (the scripts file must be included in the same project and you can download it from  http://sourceforge.net/projects/jscalendar/).
  10. Also you can specify the path of the calendar image and the format for date.

Setting up the scripts

Scripts files are downloadable from http://sourceforge.net/projects/jscalendar/

  • Download the zip file for the calendar
  • Unzip the file to folder /JSCalendar in your application
  • In the properties of your control, type “/jscalendar”

License

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

Share

About the Author

Hazem Torab
CEO Enozom Software
Egypt Egypt
Hazem Torab, founder & CEO at Enozom Software, a fast growing software company in Alexandria. Hazem has more than 6 years of experience in management and team leading, and 10+ years of professional experience in the software development field.

Hazem also is a co-founder and chairman of Ayaady for Investment and Agriculture, a crowd funded company and the first Egyptian online fresh meat shop directly from the farm to the consumers.

Before founding Enozom, Hazem was a co-founder & CEO of IRange Software. He also worked at ITWorx and Raya Software after his graduation in 2004 from Alexandria University, Faculty of Engineering, Computer and Systems Department.

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionHow to use in grid view rows Pin
soh_sid24-Aug-09 21:42
membersoh_sid24-Aug-09 21:42 
QuestionCan i use it for free? Pin
orhankemal20-Aug-07 5:23
memberorhankemal20-Aug-07 5:23 
AnswerRe: Can i use it for free? Pin
Hazem Torab23-Jan-08 10:00
memberHazem Torab23-Jan-08 10:00 
QuestionStack overflow error Pin
NyNiru27-Jun-07 7:28
memberNyNiru27-Jun-07 7:28 
Generalinput file validation(picture width and height should be less then 300 pixels.) Pin
jayvaishnav8216-Mar-07 20:54
memberjayvaishnav8216-Mar-07 20:54 
QuestionHow to Make Scedular using JSCalander Pin
Member #345857016-Mar-07 20:44
memberMember #345857016-Mar-07 20:44 
GeneralModification to Use Embedded Resources Pin
OtisAardvark4-Jan-07 5:18
memberOtisAardvark4-Jan-07 5:18 
QuestionHow to call a post back [modified] Pin
Tristy9-Aug-06 12:07
memberTristy9-Aug-06 12:07 
Hi,
I seem to have a Flat Calendar working on my page

asp:Label ID="Container" runat="server" Width="200">
asp:HiddenField ID="TextBox1" runat="server" />
asp:Label ID="Label1" runat="server" Text="">





function dateChanged(calendar) {
// Beware that this function is called even if the end-user only
// changed the month/year. In order to determine if a date was
// clicked you can use the dateClicked property of the calendar:

if (calendar.dateClicked) {
var MyD = calendar.date;
var MyTxt = document.getElementById("TextBox1");
MyTxt.value = MyD.print("%d/%m/%Y");
Label1.innerHTML = MyD.print("%d/%m/%Y");

//window.location = "Default.aspx";
}
};

Calendar.setup({
//displayArea : "TextBox1", //*
daFormat : "%d/%m/%Y",
//date : "09/08/2006",
showsTime : false,
weekNumbers : false,
range : [2006, 2009],
flat : "Container",
flatCallback : dateChanged,
//button : "MyButton", //*
step : 1
});



MyCode behind is

protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
DateTime MyStartDate = DateTime.Now.AddDays(2);
Label1.Text = MyStartDate.ToShortDateString();
}

}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Value.ToString();
}


But i want to be able to call a postback when the user changes the date
- if (calendar.dateClicked)
do post back here!!!

And i want to be able to dynamically load the date + 2 days on page load
and then each time the page post back to hold the changed date

I hope that makes sense

Can anyone help Please Please!!!!!!!!


-- modified at 17:08 Wednesday 9th August, 2006
GeneralJSCalendar Custom Control and Atlas Pin
quocvuong20052-Jul-06 18:27
memberquocvuong20052-Jul-06 18:27 
GeneralRe: JSCalendar Custom Control and Atlas Pin
jcm123426-Apr-07 2:12
memberjcm123426-Apr-07 2:12 

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
Web02 | 2.8.170308.1 | Last Updated 2 Oct 2005
Article Copyright 2005 by Hazem Torab
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid