如何在MVC Web应用程序中构建日历 [英] How to build a calendar in MVC web application

查看:99
本文介绍了如何在MVC Web应用程序中构建日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,



我是Web开发的新手。我正在使用MVC C#开发一个Web应用程序。

我想在日历视图中构建一个包含所有年份的视图,并根据保存在数据库表中的日期标记特定颜色的某些天。



请问我如何在我的视图上绘制这个日历视图,如果将这一天的日期保存在数据库表中,可以用不同的颜色标记日期。



以下是我想要的样本。



----------------------- --------------------- ----------------------

-------- 1月------- ------- 2月------- --------- 3月--------

---------------------- -------------------- - ----------------------

| S | M | T | W | T | F | S | | S | M | T | W | T | F | S | | S | M | T | W | T | F | S |

---------------------- -------------- -------- ----------------------

| 01 | 02 | 03 | 04 | 05 | 06 | 07 | | | | | 01 | 02 | 03 | 04 | | | | | 01 | 02 | 03 | 04 |

| 08 | 09 | 10 | 11 | 12 | 13 | 14 | | 05 | 06 | 07 | 08 | 09 | 10 | 11 | | 05 | 06 | 07 | 08 | 09 | 10 | 11 |

| 15 | 16 | 17 | 18 | 19 | 20 | 21 | | 12 | 13 | 14 | 15 | 16 | 17 | 18 | | 12 | 13 | 14 | 15 | 16 | 17 | 18 |

| 22 | 23 | 24 | 25 | 26 | 27 | 28 | | 19 | 20 | 21 | 22 | 23 | 24 | 25 | | 19 | 20 | 21 | 22 | 23 | 24 | 25 |

| 29 | 30 | 31 | | | | | | 26 | 27 | 28 | | | | | | 26 | 27 | 28 | 29 | 30 | 31 | |

---------------------- ------------------- --- ----------------------

Hello All,

I am new in Web Development. I am developing a web application with MVC C#.
I want to build a View which contains all year months in calendar view and mark some days with specific color based on dates saved on a database table.

Could you please how I draw this calendar view on my view and mark some days on it with different color if this day's date is saved on the database table.

Below is a sample of what I want.

---------------------- ---------------------- ----------------------
--------January------- -------February------- ---------March--------
---------------------- ---------------------- ----------------------
|S |M |T |W | T|F |S | |S |M |T |W | T|F |S | |S |M |T |W | T|F |S |
---------------------- ---------------------- ----------------------
|01|02|03|04|05|06|07| | | | |01|02|03|04| | | | |01|02|03|04|
|08|09|10|11|12|13|14| |05|06|07|08|09|10|11| |05|06|07|08|09|10|11|
|15|16|17|18|19|20|21| |12|13|14|15|16|17|18| |12|13|14|15|16|17|18|
|22|23|24|25|26|27|28| |19|20|21|22|23|24|25| |19|20|21|22|23|24|25|
|29|30|31| | | | | |26|27|28| | | | | |26|27|28|29|30|31| |
---------------------- ---------------------- ----------------------

推荐答案

看看这个!< br $> b $ b

ASP.NET MVC应用程序的事件日历 [ ^ ]


嗯,我宁愿使用 Kendo UI Scheduler [ ^ ]。它支持自定义;)



或者你可以从CodeProject文章中获得帮助:

ASP.NET MVC3:创建自定义日历/日期选择器 [ ^ ]

ASP的AJAX事件日历(调度程序)。 80行代码中的NET MVC [ ^ ]



-KR
Umm, I'd rather use the Kendo UI Scheduler[^]. And it supports customization ;)

Or you can get a help from CodeProject articles:
ASP.NET MVC3: Create a custom calendar/datepicker[^]
AJAX Event Calendar (Scheduler) for ASP.NET MVC in 80 Lines of Code[^]

-KR


这篇关于如何在MVC Web应用程序中构建日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆