计算gridview记录并在外部文本框中显示throgh javascript! [英] Count gridview records and shows in outside textbox throgh javascript!
本文介绍了计算gridview记录并在外部文本框中显示throgh javascript!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我绑定了一个gridview,我想显示总数没有。外部文本框中的记录表示文本框不在gridview中。
Hi All,
I am binding a gridview and i want to show total no. of records in a outside text box mean that textbox is not in gridview.
推荐答案
你可以试试这个: -
你的GridView:
you can try this:-
your GridView:
<asp:gridview id="gridRow" runat="server">
</asp:gridview>
你的按钮和文本框:
your button and textbox:
<input type="button" id="btn" value="Total Row" onclick="rowcount()" />
<input type="text" id="txt" />
你的javascript函数:
your javascript function:
function rowcount() {
var row = document.getElementById('<%= gridRow.ClientID %>').rows.length;
document.getElementById('txt').value = row;
}
祝你好运。
Good luck.
这篇关于计算gridview记录并在外部文本框中显示throgh javascript!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文