how to count the rows of gridview in asp net using jquery

Solutions on MaxInterview for how to count the rows of gridview in asp net using jquery by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to count the rows of gridview in asp net using jquery"
Maja
03 Jan 2021
1<script type="text/javascript">
2    $(function () {
3        $("[id*=btnGetCount]").click(function () {
4            var totalRowCount = $("[id*=GridView1] tr").length;
5            var rowCount = $("[id*=GridView1] td").closest("tr").length;
6            var message = "Total Row Count: " + totalRowCount;
7            message += "\nRow Count: " + rowCount;
8            alert(message);
9            return false;
10        });
11    });
12</script>