最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Asp.net MVC scheduler的实现方法详解
时间:2017-11-08 编辑:猪哥 来源:一聚教程网
Asp.net MVC scheduler的实现方法详解
本例使用了fullcalendar js : https://fullcalendar.io/
1. view :
@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; } @section PageContent{} @section scripts{ css" rel="external nofollow" rel="stylesheet" /> }
2. Web api controller :
... public ActionResult GetJsonData() { ... var tasks = //...logic of getting tasks ... var jsonObjs = tasks.Select(x => new FullCalendaRecord() { title = x.Subject, url = "the url", start = ..., end = x.TargetDate.Value.ToString("yyyy-MM-dd"), }).ToList(); return Json(jsonObjs, JsonRequestBehavior.AllowGet); } public class FullCalendaRecord { // sample data: //[ //{ // title: 'Click for Google', // url: 'http://google.com/', // start: '2017-09-28', // end:'2017-09-28' //} //] public string title { get; set; } public string url { get; set; } public string start { get; set; } public string end { get; set; } } ...
相关文章
- ASP.NET Identity用法解析 10-24
- ASP.NET MVC使用Identity增删改查用户介绍 10-24
- ASP.NET Core 配置文件教程 10-10
- 通用http签名组件的另类实现方式介绍 10-10
- ASP.NET MVC遍历验证ModelState的错误信息介绍 10-10
- ASP.Net Core对USB摄像头进行截图介绍 10-10