Click here to Skip to main content
15,889,403 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Performance testing for 500 concurrent users ends with 100% CPU Utilization on DB Server Pin
Richard Deeming16-Jul-14 2:20
mveRichard Deeming16-Jul-14 2:20 
GeneralRe: Performance testing for 500 concurrent users ends with 100% CPU Utilization on DB Server Pin
antony beula16-Jul-14 20:26
antony beula16-Jul-14 20:26 
Questionhow to use ajax tabcontainer in asp.net mvc 4 Pin
shwe pwint14-Jul-14 1:04
shwe pwint14-Jul-14 1:04 
AnswerRe: how to use ajax tabcontainer in asp.net mvc 4 Pin
thatraja15-Jul-14 1:02
professionalthatraja15-Jul-14 1:02 
QuestionAuthorization not working in Classic mode(Application pools) Pin
sajithnet13-Jul-14 22:37
sajithnet13-Jul-14 22:37 
AnswerRe: Authorization not working in Classic mode(Application pools) Pin
Richard Deeming16-Jul-14 2:13
mveRichard Deeming16-Jul-14 2:13 
GeneralRe: Authorization not working in Classic mode(Application pools) Pin
sajithnet16-Jul-14 22:44
sajithnet16-Jul-14 22:44 
QuestionHelp with ASP.NET Event Calendar Pin
Member 1092961012-Jul-14 8:36
Member 1092961012-Jul-14 8:36 
Hello.
I am trying to build an event calendar using ASP.net for my organization. The article I used for reference is AJAX Event Calendar (Scheduler) for ASP.NET MVC in 80 Lines of Code[^]

I have followed the instructions to the letter but I keep getting an error:

Error 1 The type or namespace name 'Event' could not be found (are you missing a using directive or an assembly reference?

What am I doing wrong?

Here are the code blocks of my application:

1)Index

@{ ViewBag.Title = "AJAX Monthly Event Calendar for ASP.NET MVC"; }

<h2>ADE R and T Event Calendar</h2>

<script src="@Url.Content("~/Scripts/DayPilot/daypilot-all.min.js")" type="text/javascript"></script>

@Html.DayPilotMonth("dp", new DayPilotMonthConfig
{
    BackendUrl = Url.Content("~/Home/Backend"),
    EventMoveHandling = DayPilot.Web.Mvc.Events.Month.EventMoveHandlingType.CallBack,
    EventResizeHandling = DayPilot.Web.Mvc.Events.Month.EventResizeHandlingType.CallBack,
    TimeRangeSelectedHandling = DayPilot.Web.Mvc.Events.Month.TimeRangeSelectedHandlingType.JavaScript,
    TimeRangeSelectedJavaScript = "dp.timeRangeSelectedCallBack(start, end, { name: prompt('New Event Name:', 'New Event') });"
})


2) HomeController.CS

using System;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DayPilot.Web.Mvc;
using DayPilot.Web.Mvc.Events.Month;

namespace Calendar1.Controllers
{
 public class HomeController : Controller
  {
    public ActionResult Index()
    {
      return View();
    }

    public ActionResult Backend()
    {
      return new Dpm().CallBack(this);
    }

    class Dpm : DayPilotMonth
    {
 protected override void OnInit(InitArgs e)
      {
        var dbo = new DataClasses1DataContext();
        Events = from ev in dbo.events select ev;

        DataIdField = "EventID";
        DataTextField = "EventText";
        DataStartField = "EventStart";
        DataEndField = "EventEnd";
        Update();
      }
 protected override void OnEventMove(EventMoveArgs e)
 {
        var dbo = new DataClasses1DataContext();
        Events = from ev in dbo.events select ev;

     var toBeResized = (from ev in dbo.events where ev.EventID == Convert.ToInt32(e.Id) select ev).First();
     toBeResized.EventStart = e.NewStart;
     toBeResized.EventEnd = e.NewEnd;
     dbo.SubmitChanges();
     Update();
 }
 protected override void OnEventResize(EventResizeArgs e)
 {
     var dbo = new DataClasses1DataContext();
     Events = from ev in dbo.events select ev;

     var toBeResized = (from ev in dbo.events where ev.EventID == Convert.ToInt32(e.Id) select ev).First();
     toBeResized.EventStart = e.NewStart;
     toBeResized.EventEnd = e.NewEnd;
     dbo.SubmitChanges();
     Update();
 }
 protected override void OnTimeRangeSelected(TimeRangeSelectedArgs e)
 {
     var dbo = new DataClasses1DataContext();
     Events = from ev in dbo.events select ev;

     var toBeCreated = new Event { EventStart = e.Start, EventEnd = e.End, text = (string)e.Data["name"] };
     dbo.events.InsertOnSubmit(toBeCreated);
     dbo.SubmitChanges();
     Update();
 }

 public object toBeCreated { get; set; }
    }
    }
  }


3) Web.config

XML
<?xml version="1.0"?>

<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="DayPilot.Web.Mvc"/>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
        <add namespace="Calendar1" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>

  <system.webServer>
    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
</configuration>



I am using Visual Studio 2013. Are there any changes I need to make to the code? Most of it I copy-pasted from the article used for reference.

I apologize if the question is too long. Thanks in advance!
Please let me know what I am doin
QuestionWhat is Katna in asp.net Pin
Tridip Bhattacharjee10-Jul-14 21:29
professionalTridip Bhattacharjee10-Jul-14 21:29 
AnswerRe: What is Katna in asp.net Pin
thatraja10-Jul-14 22:03
professionalthatraja10-Jul-14 22:03 
AnswerRe: What is Katna in asp.net Pin
ZurdoDev11-Jul-14 1:51
professionalZurdoDev11-Jul-14 1:51 
AnswerRe: What is Katna in asp.net Pin
Praveen Dselva24-Jul-14 0:09
professionalPraveen Dselva24-Jul-14 0:09 
QuestionSetting the StatusCode of the response Pin
ThetaClear10-Jul-14 0:16
ThetaClear10-Jul-14 0:16 
QuestionRe: Setting the StatusCode of the response Pin
thatraja10-Jul-14 4:35
professionalthatraja10-Jul-14 4:35 
AnswerRe: Setting the StatusCode of the response Pin
ThetaClear10-Jul-14 7:36
ThetaClear10-Jul-14 7:36 
AnswerRe: Setting the StatusCode of the response Pin
thatraja10-Jul-14 21:58
professionalthatraja10-Jul-14 21:58 
GeneralRe: Setting the StatusCode of the response Pin
ThetaClear12-Jul-14 21:37
ThetaClear12-Jul-14 21:37 
GeneralRe: Setting the StatusCode of the response Pin
ThetaClear12-Jul-14 22:54
ThetaClear12-Jul-14 22:54 
AnswerRe: Setting the StatusCode of the response Pin
jkirkerx11-Jul-14 11:17
professionaljkirkerx11-Jul-14 11:17 
QuestionDynamic reports in asp.net Pin
Member 105902599-Jul-14 21:17
Member 105902599-Jul-14 21:17 
AnswerRe: Dynamic reports in asp.net Pin
thatraja10-Jul-14 4:37
professionalthatraja10-Jul-14 4:37 
AnswerRe: Dynamic reports in asp.net (Using Formula Fields) Pin
Vikas Joshi (Sofware Developer)14-Jul-14 21:53
Vikas Joshi (Sofware Developer)14-Jul-14 21:53 
QuestionTexbox OnKeyPress event thru javascript executes a button click event Pin
bjay tiamsic8-Jul-14 15:23
bjay tiamsic8-Jul-14 15:23 
QuestionGridView Structure Clone Pin
sakalans8-Jul-14 5:35
sakalans8-Jul-14 5:35 
AnswerRe: GridView Structure Clone Pin
thatraja9-Jul-14 0:44
professionalthatraja9-Jul-14 0:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.