ASP.NET MVC Calendar component

I am writing simple ASP.NET MVC system that I plan to publish with source code pretty soon. I needed some simple calendar component that doesn’t require ASP.NET server-side form to work. I found different JavaScript based calendars and only one pretty oldcalendar that was specially written for ASP.NET MVC. I updated it and here is the source and binary downloads for Visual Studio 2008 and ASP.NET MVC 1.0.

MVC calendar exampleWell, this component is written for ASP.NET MVC Preview and with my modifications it also works for MVC 1.0 too. I was not able to get contact with author so I published files here. I changed no names of namespaces and classes, so it is easy to merge my changes to current code if author wishes it.

Image on the right side shows how the calendar looks like with default settings. Calendar has its own CSS file so it is very easy to change the look of it. Currently the calendar needs some modifications and I’m trying my modifications there as soon as possible.

You can use calendar on your views like this:

var dates = new DateTime[2];
dates[0] = new DateTime(2009, 7, 12);
dates[1] = new DateTime(2009, 7, 29);
= Html.Calendar("id",DateTime.Now,dates,"Controller","Action")%>

Seems convenient, at least to me. If I make any significant modifications I will write new posting here that describes new features.



Visual Studio 2008 Project with binaries

Size: 28KB


See also

Leave a Reply

Your email address will not be published. Required fields are marked *