Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
DZone MVB

Links

Social

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 old calendar 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.

ASP.NET MVC calendar Well, 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.

Download

zip

AllWebIdea.zip
Visual Studio 2008 Project with binaries
Size: 28KB


kick it on DotNetKicks.com pimp it Progg it 顶 Shout it
vote it on WebDevVote.com

Comments

DotNetShoutout said:

Thank you for submitting this cool story - Trackback from DotNetShoutout

# July 27, 2009 2:59 AM

DotNetBurner - ASP.net said:

DotNetBurner - burning hot .net content

# July 27, 2009 3:00 AM

PimpThisBlog.com said:

Thank you for submitting this cool story - Trackback from PimpThisBlog.com

# July 27, 2009 3:01 AM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# July 27, 2009 3:02 AM

progg.ru said:

Thank you for submitting this cool story - Trackback from progg.ru

# July 27, 2009 3:03 AM

9eFish said:

9efish.感谢你的文章 - Trackback from 9eFish

# July 27, 2009 3:04 AM

WebDevVote.com said:

You are voted (great) - Trackback from WebDevVote.com

# July 27, 2009 3:05 AM

ASP.NET MVC Calendar component | ASP Scribe said:

Pingback from  ASP.NET MVC Calendar component | ASP Scribe

# July 27, 2009 3:06 AM

Justin said:

Just out of curiousity did you give any thought to using the Calendar control from jquery ui?

# July 27, 2009 9:32 AM

DigiMortal said:

Hi Justin!

I thought about jQuery plugins but they doesn't fit to my context easily. I needed just calendar that shows links with dates that I ask with LINQ query. Users can click on dates and see what information is related to selected date.

I know that there are also pretty cool plugins for jQuery.

# July 27, 2009 12:30 PM

ASP.NET MVC Calendar component - Gunnar Peipman's ASP.NET blog said:

Pingback from  ASP.NET MVC Calendar component - Gunnar Peipman&#39;s ASP.NET blog

# July 27, 2009 1:35 PM

ASP.NET MVC Calendar component – Gunnar Peipman's ASP.NET blog | Webmaster Tools said:

Pingback from  ASP.NET MVC Calendar component &#8211; Gunnar Peipman&#039;s ASP.NET blog | Webmaster Tools

# July 27, 2009 3:39 PM

Daily Links for Tuesday, July 28th, 2009 said:

Pingback from  Daily Links for Tuesday, July 28th, 2009

# July 28, 2009 7:36 AM

Md. Zikrul Ahsan said:

This is really very easy and cool code... Thanks for posting such coding...

- Md. Zikrul Ahsan

http://www.dotnetcommunity.tk/

# July 29, 2009 11:04 AM

ASP.NET MVC Archived Blog Posts, Page 1 said:

Pingback from  ASP.NET MVC Archived Blog Posts, Page 1

# August 2, 2009 11:46 PM

Kuppens stijn said:

Where can I find the CSS file to change the look of tour modified calendar? I implemented it in a existing MVC-project but the only thing I got was a calendar without any visible borders etc...

Kindest regards,

Stijn

# September 17, 2009 6:57 AM

Amanda said:

Thanks for submitting this - I do have a question though.  The next and previous months are not navigating correctly.  Thanks for your help.

# March 31, 2010 3:07 PM