Posts

Showing posts with the label model-view-controller

json being returned via url but not via jquery

json being returned via url but not via jquery I'm using Visual Studio to develop an MVC app and I have a jquery function that seems to be causing problems. I developed an action method that returns a json object (jquery calls action > action calls a service > the service returns an object > action converts object to a model via a map then passes the model to json). The action can be called via url (passing an id parameter via the query string) and it returns the json to the web page, however, when I call the jquery function via the web page (click on a button that executes the jquery), I get a "localhost:50216 says an error has occurred" before the rest of the jquery function executes. Been researching this for several days and tried using Chrome's debugger to no avail. Hopefully this makes sense, but if I need to provide further information please let me know. Any insight would be much appreciated. Best, Jon $("#delayEditModal") .on("show...

Binding controller data to kendo chart

Binding controller data to kendo chart I am using Kendo Chart with MVC. The model is public class DailyProduction { public DateTime ProductionDate { get; set; } public double Value { get; set; } } The action controller is public ActionResult DailyProduction([DataSourceRequest]DataSourceRequest request) { List<DailyProduction> dailyProduction = new List<DailyProduction>(); dailyProduction.Add(new DailyProduction (DateTime.Today.AddDays(-3), 10)); dailyProduction.Add(new DailyProduction (DateTime.Today.AddDays(-2), 20)); dailyProduction.Add(new DailyProduction (DateTime.Today.AddDays(-1), 30)); return Json(dailyProduction.ToDataSourceResult(request)); } The kendo chart in the view is @(Html.Kendo().Chart<Origin.DTO.DailyProduction>() .Name("Chart") .AutoBind(true) .DataSource(ds => ds.Read(read => read.Action("DailyProduction", "Production")) ...