hmm strange !
your sample worked perfectly but not mine ...
now i am getting internal server error 500
i am using a webservice to get the data and according to this
page, it's possible .
here what i have tried
var dataManager = ej.DataManager({url: "MyWebService.asmx/freqchartMonth"});
var promise = dataManager.executeQuery(new ej.Query());
promise.done(function (e) {
alert(e.result);
});
and my webmethod code wich is working correctly and returning data if i run it from the asmx test page
[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = false)]
[WebMethod(EnableSession = true)]
public string freqchartMonth()
{
using (MyDBEntities ctx = new MyDBEntities())
{
var model = ctx.CONNECTIONS_STATS
.GroupBy(o => new
{
Month = ((DateTime)o.CS_DATE).Month,
Year = ((DateTime)o.CS_DATE).Year
})
.ToList()
.Select(g => new FreqChartData()
{
DT = (new DateTime(g.Key.Year, g.Key.Month, 1)),
connectpat = g.Where(a => a.CS_TYPE_USER == 0).Count(),
connectmed = g.Where(a => a.CS_TYPE_USER == 1).Count()
})
.OrderBy(a => a.DT.Year)
.ThenBy(a => a.DT.Month)
.ToList();
JavaScriptSerializer serializer = new JavaScriptSerializer();
var result = serializer.Serialize(model.ToList());
return result;
}
}
i have also tried returning a List<FreqChartData> with the same issue .
any idea pleas eon what going on ?
ps : please add quotes and code balise to the post editor ;)