最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net取得复选框值代码
时间:2022-06-25 03:16:25 编辑:袖梨 来源:一聚教程网
我们介绍关于利用asp教程.net 获取checkbox值的几种方法,
html代码
c获取值。
{
int i ;
string str = "";
for (i = 0; i
if (checkboxlist1.items[i].selected ) str+ =checkboxlist1.items[i].value;
label1.text=str;
}
下面讲一下关于
第一种:获得checkbox的值
string save_cbljl = "";
for (int i = 0; i < this.cbljl.items.count; i++)
{
if (this.cbljl.items[i].selected == true)
{
save_cbljl += this.cbljl.items[i].value + ",";
}
}
response.write(save_cbljl);string save_cbljl = "";
for (int i = 0; i < this.cbljl.items.count; i++)
{
if (this.cbljl.items[i].selected == true)
{
save_cbljl += this.cbljl.items[i].value + ",";
}
}
response.write(save_cbljl);
第二种:获得checkbox的值
string str_save_cbljl = "";
foreach (listitem li in cbljl.items)
{
if (li.selected == true)
{
str_save_cbljl += li.value + ",";
}
}
response.write(str_save_cbljl);
相关文章
- 中科闻歌发布首个AI决策全家桶:企业决策卷入10分钟时代 07-19
- neo4j的数据库如何提升查询性能 07-19
- neo4j的数据库可实现实时更新吗 07-19
- neo4j的数据库如何进行数据建模 07-19
- neo4j数据库适合推荐系统吗 07-19
- neo4j的数据库能支撑大规模图数据吗 07-19