$('#calendar').fullCalendar
(
{
editable: true,
events:
$.ajax
(
{
type: "POST",
url: "Calender.aspx/GetCDCatalog",
contentType: "application/json; charset=utf-8",
data: "{}",
dataType: "json"
}
)
}
)
calender.aspx是頁面和getcddialog是函數返回類型是行得結合壓延機陣列。需要幫助如何調用C#函數返回類型爲jQuery的數組
public CD[] GetCDCatalog()
{
XDocument docXML =
XDocument.Load(Server.MapPath("mydata.xml"));
var CDs =
from cd in docXML.Descendants("Table")
select new CD
{
title = cd.Element("title").Value,
star = cd.Element("star").Value,
endTime = cd.Element("endTime").Value,
};
return CDs.ToArray<CD>();
}
您使用的是webforms還是mvc? – 2010-04-28 14:56:09