最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp.net取得复选框值代码
时间:2010-12-07 编辑:简简单单 来源:一聚教程网
我们介绍关于利用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);
相关文章
- ASP.NET 窗体间传值实现方法详解 07-29
- Asp.net 给DropDownList赋值方法 03-29
- C#复制数组的两种方式及效率比较解读 10-24
- ASP.NET Identity用法解析 10-24
- ASP.NET MVC使用Identity增删改查用户介绍 10-24
- C语言中atoi函数模拟实现介绍 10-18