Need help how to call c# function which return type is array in jquery

Posted by Manoj Wadhwani on Stack Overflow See other posts from Stack Overflow or by Manoj Wadhwani
Published on 2010-04-28T14:45:18Z Indexed on 2010/04/28 15:03 UTC
Read the original article Hit count: 245

Filed under:
$('#calendar').fullCalendar
        (

            {
                editable: true,
                events:
                $.ajax
                (
                    {
                        type: "POST",
                        url: "Calender.aspx/GetCDCatalog",
                        contentType: "application/json; charset=utf-8",
                        data: "{}",
                        dataType: "json"
                    }
                )

            }
       )

calender.aspx is page and getcddialog is function which return type is array which doest not bind calender.

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>();
}

© Stack Overflow or respective owner

Related posts about jQuery