会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
金色約定之家
十里平湖霜满天,寸寸青丝愁华年。对月形单望相护,只羡鸳鸯不羡仙。
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
;
}
}
}
posted on
2007-05-18 11:40
★金★
阅读(
8095
) 评论(
8
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
导航
首页
新随笔
联系
订阅
管理
公告