checkboxlist计数 [英] checkboxlist count

查看:70
本文介绍了checkboxlist计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用复选框列表生成了一个复选框列表(在运行时)

控件。

i想要在每个复选框上添加onclick事件,这样我就可以执行计数了

每次点击一个复选框时选择了多少项目。


我该怎么做?记住,复选框是在运行时生成的。


谢谢

i have generated a list of checkboxes (at runtime) using the checkboxlist
control.
i want to add an onclick event onto each checkbox so i can perform a count
of how many items have been selected every time a checkbox is clicked.

how can i do this? remember, the checkboxes are generated at runtime.

thanks

推荐答案

你应该能够添加一个当你创建时,每个复选框都有一个eventhandler

it - 你也需要在回发时做。既然你想要做的就是计算,你可以使用相同的处理程序。


suzy <苏** @ spam.com>在留言中写道

新闻:KG ****************** @ doctor.cableinet.net ...
You should be able to add an eventhandler to each checkbox as you create
it - which you''ll need to do on postback as well. Since all you want to do
is count, you can use the same handler.

"suzy" <su**@spam.com> wrote in message
news:KG******************@doctor.cableinet.net...
i使用checkboxlist
控件生成了一个复选框列表(在运行时)。

i想在每个复选框上添加一个onclick事件,这样我就可以对多少项进行计数
每次点击一个复选框时都会被选中。

我该怎么做?请记住,复选框是在运行时生成的。

感谢
i have generated a list of checkboxes (at runtime) using the checkboxlist
control.
i want to add an onclick event onto each checkbox so i can perform a count
of how many items have been selected every time a checkbox is clicked.

how can i do this? remember, the checkboxes are generated at runtime.

thanks



但是如果使用数据绑定方法,而不是
a循环?


如何为每个复选框分配一个事件处理程序呢?

" Rick Spiewak" ; < RI ********* @ mindspring.com>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
but what if the checkboxlist is created using a databind method, rather than
a loop?

how do i assign an eventhandler to each checkbox then?
"Rick Spiewak" <ri*********@mindspring.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
你应该能够在创建
时为每个复选框添加一个事件处理程序 - 您还需要在回发时执行此操作。既然你想要做的只是计数,你可以使用相同的处理程序。

suzy <苏** @ spam.com>在消息中写道
新闻:KG ****************** @ doctor.cableinet.net ...
You should be able to add an eventhandler to each checkbox as you create
it - which you''ll need to do on postback as well. Since all you want to do
is count, you can use the same handler.

"suzy" <su**@spam.com> wrote in message
news:KG******************@doctor.cableinet.net...
我已生成一个列表使用
复选框列表控件的复选框(在运行时)。

i想要在每个复选框上添加一个onclick事件,这样我就可以执行
计算每个选择的项目数时间点击一个复选框。

我该怎么做?记住,复选框是在运行时生成的。

感谢
i have generated a list of checkboxes (at runtime) using the checkboxlist control.
i want to add an onclick event onto each checkbox so i can perform a count of how many items have been selected every time a checkbox is clicked.

how can i do this? remember, the checkboxes are generated at runtime.

thanks




ps :我希望计数在客户端执行

Rick Spiewak < RI ********* @ mindspring.com>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
ps: i want the count to be performed on the client-side
"Rick Spiewak" <ri*********@mindspring.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
你应该能够在创建
时为每个复选框添加一个事件处理程序 - 您还需要在回发时执行此操作。既然你想要做的只是计数,你可以使用相同的处理程序。

suzy <苏** @ spam.com>在消息中写道
新闻:KG ****************** @ doctor.cableinet.net ...
You should be able to add an eventhandler to each checkbox as you create
it - which you''ll need to do on postback as well. Since all you want to do
is count, you can use the same handler.

"suzy" <su**@spam.com> wrote in message
news:KG******************@doctor.cableinet.net...
我已生成一个列表使用
复选框列表控件的复选框(在运行时)。

i想要在每个复选框上添加一个onclick事件,这样我就可以执行
计算每个选择的项目数时间点击一个复选框。

我该怎么做?记住,复选框是在运行时生成的。

感谢
i have generated a list of checkboxes (at runtime) using the checkboxlist control.
i want to add an onclick event onto each checkbox so i can perform a count of how many items have been selected every time a checkbox is clicked.

how can i do this? remember, the checkboxes are generated at runtime.

thanks




这篇关于checkboxlist计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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