Detailed Implementation of Asp.net MVC scheduler, mvcscheduler

Source: Internet
Author: User

Detailed Implementation of Asp.net MVC scheduler, mvcscheduler

Implementation of Asp.net MVC scheduler

This example uses fullcalendar js: https://fullcalendar.io/

1. view:

@{   ViewBag.Title = "Index";   Layout = "~/Views/Shared/_Layout.cshtml"; }     @section PageContent{   <style>     .modal-backdrop {       z-index: 9;     }   </style>   <div class="container">       <div id='calendar'>       </div>   </div>       <!--Select Staff-->   <div class="container">     <!-- Trigger the modal with a button -->     <button type="button" id="btnSelectStaff" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal" style="display: none"></button>       <!-- Modal -->     <div class="modal fade" id="myModal" role="dialog" style="z-index: 10">       <div class="modal-dialog modal-lg">         <br /><br /><br />         <!-- Modal content-->         <div class="modal-content">          @using (Html.BeginForm("AssignTask", "PMPlan", FormMethod.Post, new { @class="form-horizontal", role="form"} ))         {               <div class="modal-header">               <button type="button" class="close" data-dismiss="modal">×</button>               

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; }     }   ... 

If you have any questions, please leave a message or go to the community on this site for discussion. Thank you for reading this article. Thank you for your support!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.