[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetSubCategories(int CategoryId)
{
DataTable dt = BusinessLayer.ycfoCore.populateSubCategories(CategoryId.ToString());
var query = from row in dt.AsEnumerable()
select new
{
Id = row["Id"].ToString(),
Name = (string)row["Name"]
};
JObject o = JObject.FromObject(new
{
Table = query
});
return o.ToString();
}