如何对页脚模板中的中继器列求和 [英] How to Sum column of a repeater in footer template
本文介绍了如何对页脚模板中的中继器列求和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个中继器,并在中继器的列中显示了整数类型值,并希望对asp.net中的页脚模板中的列的所有值求和.
请帮帮我.
谢谢你
莫哈末Wasif
Hi All,
I have a repeater and have shown integer type value in a column of repeater and want to sum all the values of column in footer template in asp.net.
Please help me.
Thanking You
Mohd. Wasif
推荐答案
^ ]文章肯定会对您有所帮助.
This[^] article should surely help you out.
您可以在服务器端轻松地做到这一点,如果您想使用jquery在客户端执行此操作
将一个类分配给您在其中显示int值的转发器中的每个文本框,例如class ="payToSum".
然后做这样的事情...
you can do it at server side easily i think, if you want to do it at client side using jquery
assign a class to each text box in repeater where you displaying the int value say class="payToSum".
then do something like this...
<br />
var totalPay = 0;<br />
var errorOccured = 0; <br />
("input.payToSum").each(function(i) { <br /> var val = this.value.toString(); <br /> totalPay = totalPay + parseFloat(val);<br /> });<br />
("input.payToSum").each(function(i) { <br /> var val = this.value.toString(); <br /> totalPay = totalPay + parseFloat(val);<br /> });<br />
在页脚中显示totalPay
show totalPay in footer
这篇关于如何对页脚模板中的中继器列求和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文