关于网友提出的“repeater控件 Repeater删除报There is no row at position 9 的错误”问题疑问,本网通过在网上对“repeater控件 Repeater删除报There is no row at position 9 的错误”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题:repeater控件 Repeater删除报There is no row at position 9 的错误
描述: --页面
' >' >
--后台
protected void bt_tuifang_Click(object sender, EventArgs e)
{
this.bt_tuifang.Enabled = false;
for (int i = 0; i < Repeater1.Items.Count; i++)
{
CheckBox cb = (CheckBox)Repeater1.Items[i].FindControl("CheckBox1");
if (cb.Checked)
{
(new NeiBin_BLL()).Update_TuiFang2(cb.ToolTip.ToString());
}
}
Repeater1.Dispose();
bind();
this.bt_tuifang.Enabled = true;
}
用这个删除时有时候正常,有事就会报There is no row at position 9 这一类的的错误,这是怎么回事??
解决方案1: bind的详细代码贴一下
解决方案2: Repeater1.Dispose();去掉
贴bind()代码。
删除之后从新绑定一下
There is no row at position 9
第9行没有数据了 你在删除要出错。。
以上介绍了“repeater控件 Repeater删除报There is no row at position 9 的错误”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2291896.html