How to count the rows in a gridview in asp.net using jQuery

前端 未结 4 1428
逝去的感伤
逝去的感伤 2021-01-13 04:54

Does anyone know how to count the no of rows in asp:GridView using jQuery. If no rows found then I want to do stuff...

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-13 05:28

    I tried this var totalRows = $("#<%=GridView1.ClientID %> tr").length; and it failed when I tried

    var count = $get("mygridviewclientid").rows.length
    

    it gave the count of all the rows (th and tr) I also made sure that the attribute ClientIDMode="Static"

提交回复
热议问题