DataTable to Json using jquery

前端 未结 9 1212
抹茶落季
抹茶落季 2020-12-16 05:48

I\'m trying to execute a web service which returns a DataTable with the following piece of code:

$.ajax({  
    type: \"POST\",  
    url: url,  
    data: d         


        
9条回答
  •  轮回少年
    2020-12-16 06:17

    I found this C# class very useful:

    [Serializable]
    public class TableMethod
    {
        private int m_total; public int total { get { return this.m_total; } set { this.m_total = value; } }
        private int m_page; public int page { get { return this.m_page; } set { this.m_page = value; } }
        private int m_records; public int records { get { return this.m_records; } set { this.m_records = value; } }
        private IList m_rows; public IList rows { get { return this.m_rows; } set { this.m_rows = value; } }
        public TableMethod()
        {
            this.m_records = 20;
            this.m_total = 20;
            this.m_page = 1;
        }
    }
    [Serializable]
    public class RowElement
    {
        public string id;
        public string[] cell;
    }
    

提交回复
热议问题