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

前端 未结 4 1439
逝去的感伤
逝去的感伤 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:32

    A GridView is just rendered as a standard HTML table, so just count the number of tr elements under the GridView:

    var totalRows = $("#<%=GridView1.ClientID %> tr").length;
    

提交回复
热议问题