Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6221409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:07:44+00:00 2026-05-24T08:07:44+00:00

I am trying to implement jquery full calendar with json event updates. I have

  • 0

I am trying to implement jquery full calendar with json event updates. I have no idea why oit’s not working. Her is my layout.cstml head

<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="../../Scripts/fullcalendar.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript">        </script>
<script src="../../Scripts/jquery-1.3.2.js" type="text/javascript"></script>
<link href="../../Content/fullcalendar.css" rel="stylesheet" type="text/css" />
<link href="../../Content/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css"    />



 </head>

Here is my index.cshtml

@{
ViewBag.Title = "Home Page";
}


 <h2>@ViewBag.Message</h2>
 <p>
To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET    MVC     Website">http://asp.net/mvc</a>.
 </p>

   <script type="text/javascript">
     $(document).ready(function () {
     $('#calendar').fullCalendar({
            events: "/Home/CalendarData"
        });
    });  
   </script>

  <div id="calendar">
  </div>

And my controller

 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Web;
 using System.Web.Mvc;
 using MvcApplication4.Models;

 namespace MvcApplication4.Controllers
  {
   public class HomeController : Controller
   {
    public ActionResult Index()
    {
        ViewBag.Message = "Welcome to ASP.NET MVC!";

        return View();
    }

    public ActionResult About()
    {
        return View();
    }


    [HandleError]

        public ActionResult CalendarData()
        {
            IList<CalendarDTO> tasksList = new List<CalendarDTO>();

            tasksList.Add(new CalendarDTO
            {
                id = 1,
                title = "Google search",
                start = ToUnixTimespan(DateTime.Now),
                end = ToUnixTimespan(DateTime.Now.AddHours(4)),
                url = "www.google.com"
            });
            tasksList.Add(new CalendarDTO
            {
                id = 1,
                title = "Bing search",
                start = ToUnixTimespan(DateTime.Now.AddDays(1)),
                end = ToUnixTimespan(DateTime.Now.AddDays(1).AddHours(4)),
                url = "www.bing.com"
            });

            return Json(tasksList);
        }

        private long ToUnixTimespan(DateTime date)
        {
            TimeSpan tspan = date.ToUniversalTime().Subtract(
         new DateTime(1970, 1, 1, 0, 0, 0));

              return (long)Math.Truncate(tspan.TotalSeconds);
        }
       }
   }

I’m getting nothing in my view. Any suggestions? Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:07:45+00:00Added an answer on May 24, 2026 at 8:07 am

    Javascript include order does matter here…

    You should be putting jQuery lib above the jQueryUI lib, and then the fullCalendar lib.

    EDIT: Also, you should use the Url.Content() like in the first CSS tag. This helps resolve the actual server pathing when the page loads. You don’t want to use relative pathing.

    So your tags should look like…

    <!DOCTYPE html>
    <html>
    <head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.3.2.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.7.2.custom.min.js")" type="text/javascript"></script>    
    <script src="@Url.Content("~/Scripts/fullcalendar.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/fullcalendar.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery-ui-1.7.2.custom.css")" rel="stylesheet" type="text/css"    />
    

    Edit 2:
    Actually, I think I see the real reason you’re not getting anything in your view.

    In your layout.cshtml, you’ll need to add a body tag. Soo…

    <!DOCTYPE html>
    <html>
    <head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/fullcalendar.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript">        </script>
    <script src="../../Scripts/jquery-1.3.2.js" type="text/javascript"></script>
    <link href="../../Content/fullcalendar.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css"    />
    
    
    
    </head>
    <body>
        <div id="page">
            @RenderBody()
        </div>
    </body>
    

    You need the RenderBody() method so the Razor engine knows where to put the view content that isn’t defined in a section. You can’t have more than one RenderBody() method in the layout view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement a slideshow using jQuery I have a button called
I'm trying to implement back button on this full ajax website.. I tried jquery
I'm working on a mobile view of our site. I'm trying to implement JQuery
Has anyone been able to implement the JQuery grid plugin, jqGrid? I'm trying to
I'm trying to implement a data compression idea I've had, and since I'm imagining
I have been trying to implement Win32's MessageBox using GTK. The app uses SDL/OpenGL,
We are trying to implement a REST API for an application we have now.
I've been trying to implement jQuery's grid function in my Asp.Net MVC app. I'm
I'm trying to implement a jQuery slider control for opacity of a certain element
I am trying to implement this jQuery auto complete function but the problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.