1、创建新的操作方法来显示视图:
[javascript]
view plain
copy
- public ActionResult Index()
- {
- return View();
- }
2、添加日历
WebForms
[javascript]
view plain
copy
- <%: Html.Kendo().Calendar()
- .Name("calendar") //The name of the calendar is mandatory. It specifies the "id" attribute of the widget.
- .Min(new DateTime(2010, 1, 1, 10, 0, 0)) //Set min time of the calendar
- .Max(new DateTime(2010, 1, 1, 20, 0, 0)) //Set min date of the calendar
- .Value(DateTime.Now) //Set the value of the calendar
- %>
Razor
[javascript]
view plain
copy
- @(Html.Kendo().Calendar()
- .Name("calendar") //The name of the calendar is mandatory. It specifies the "id" attribute of the widget.
- .Min(new DateTime(2010, 1, 1, 10, 0, 0)) //Set min time of the calendar
- .Max(new DateTime(2010, 1, 1, 20, 0, 0)) //Set min date of the calendar
- .Value(DateTime.Now) //Set the value of the calendar
- )
访问Existing Calendar
通过jQuery.data()引用一个现有日历实例,一旦建议了引用,就可以使用API来控制它的行为。
访问现有日历实例
>>>示例源码
处理Kendo UI Calendar事件
通过Kendo UI Calendar可以订阅所有的事件。
>>>示例源码
>>> Kendo UI Web 下载