使用 Javascript 的 ASP.NET GridView 行数 [英] ASP.NET GridView row count using Javascript

查看:32
本文介绍了使用 Javascript 的 ASP.NET GridView 行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有了 GridView 客户端控件 ID,我想获得一些关于如何计算 GridView 行数的想法,或者至少能够判断 GridView 上是否至少有一行,限制是我只能使用客户端侧代码(本例中为 JavaScript)

Having the GridView client control ID, I would like to get some ideas on how to count the GridView rows or at least be able to tell if there is at least one row on the Gridview the restriction is that I can only use client side code (JavaScript in this case)

推荐答案

var rowscount = document.getElementByID('<%=Gridview1.ClientID%>').rows.length;

alert(rowscount);

这篇关于使用 Javascript 的 ASP.NET GridView 行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆