zoukankan
html css js c++ java
CheckBoxList取值及勾选上
string
strrighgs
=
""
;
for
(
int
i
=
0
; i
<
this
.cblrighgs.Items.Count; i
++
)
{
if
(
this
.cblrighgs.Items[i].Selected
==
true
)
{
strrighgs
+=
this
.cblrighgs.Items[i].Value
+
"
|
"
;
}
}
string
str
=
""
;
foreach
(ListItem li
in
cblrighgs.Items)
{
if
(li.Selected
==
true
)
{
str
+=
li.Value
+
"
;
"
;
}
}
Response.Write(str);
Response.End();
勾选上:
string
[] strtemp
=
strapp.Split(
'|
'
);
foreach
(
string
str
in
strtemp)
{
for
(
int
i
=
0
; i
<
cblrighgs.Items.Count; i
++
)
{
if
(
this
.cblrighgs.Items[i].Value
==
str)
{
this
.cblrighgs.Items[i].Selected
=
true
;
}
}
}
查看全文
相关阅读:
jsp4个作用域
jsp9个内置对象
jsp指令
jsp注释
jsp原理
java面试
代理
泛型
exception
基础
原文地址:https://www.cnblogs.com/cnaspnet/p/751293.html
最新文章
EL基础
重定向和转发
jsp页面跳转和请求的各种方法
springMVC
springAOP2
springAOP
ajax
servlet文件的上传和下载
select中向页面输出文件路径问题
ajax&&json
热门文章
EL表达式
初识EL
自定义jdbc框架
事务
数据库连接池
statement
jdbc&&oracle
jdbc&&mysql
jdbc1
jsp标签
Copyright © 2011-2022 走看看