<div class="col control-section">
<div class="content-wrapper">
@(Html.EJS().Schedule("schedule")
.Width("100%")
.Height("650px")
.EventRendered("onEventRendered")
//.EventSettings(new ScheduleEventSettings { DataSource = ViewBag.datasource })
.EventSettings(e => e.DataSource(d => d.Url("Home/GetAppointmentData").CrudUrl("Home/SaveAppointmentData").Adaptor("UrlAdaptor").CrossDomain(true)))
.SelectedDate(DateTime.Now).Render()
)
</div>
</div>
Home/GetAppointmentData generates the JSON as in the attached file.
public class AppointmentData
{
public int Id { get; set; }
public string Subject { get; set; }
public string Location { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public string CategoryColor { get; set; }
}
In the browser console, I get this error.
Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Object.parseJson (ej2.min.js:10)
at e.onSuccess (ej2.min.js:10)
at e.successHandler (ej2.min.js:10)
at e.stateChange (ej2.min.js:10)
at XMLHttpRequest.t.httpRequest.onreadystatechange (ej2.min.js:10)
I have run the content through several JSON parsers online and all of them show no error with the content. What am I missing, please?
There appears to be no format of legal JSON that will get past this error, can anyone help me
Just as I was starting to make good progress working out how the scheduler actually works because the documentation is poor, incorrect or inconsistent (or all of these).
getappointmentdata_376cff.zipAttachment:
getappointmentdata_4d171cbd.zip