首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

checkboxlist的selected值为何不改变?解决方案

2012-04-28 
checkboxlist的selected值为何不改变?C# codestring strN for (int i 0 i chklstN.Items.Count

checkboxlist的selected值为何不改变?

C# code
        string strN = "";        for (int i = 0; i < chklstN.Items.Count; i++)        {            if (this.chklstN.Items[i].Selected)                strN += chklstN.Items[i].Value+";";        }

已经全部将复选框选中,并且AutoPostBack也设为了false,但循环中的每一个this.chklstN.Items[i].Selected都为false,
不知是什么原因?

[解决办法]
if (this.chklstN.Items[i].Checked)

[解决办法]
探讨
if (this.chklstN.Items[i].Checked) 

[解决办法]
探讨
引用:
if (this.chklstN.Items[i].Checked)

可checkboxlist的Items[i]无Checked属性

[解决办法]
楼主那段代码没有错的!
如果做过无刷新的话并且局部刷新的内容包括那个控件的话就会出错的!~就会出错!~

热点排行