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>