悬赏园豆:20
[已解决问题]
浏览: 2492次
解决于 2008-06-18 09:26
<P>像发评系统中那样 我做了一个DataList中的控件,在这个控件里有两个按钮 ,修改和删除 (linkbutton)型 ,我想做的操作是:当前登录用户发表的就显示出来 如果不是就隐藏</P>
<P>我在数据绑定后用 </P>
<P> DataTable dt = cbll.getComment(cinfo);</P>
<P>if (dt != null && dt.Rows.Count > 0)<BR> {<BR> //判断登录人是否为发布人<BR> UserInfo uinfo = UserBLL.GetLogonInfo();<BR> this.dlcomment.DataSource = dt;<BR> for (int i = 0; i < dt.Rows.Count; i++)<BR> {<BR> if (uinfo.Uid == Convert.ToInt32(dt.Rows[i]["uid"].ToString()))<BR> {<BR> this.dlcomment.Controls[i].FindControl("lkbUpdate").Visible = true;<BR> this.dlcomment.Controls[i].FindControl("lkbDel").Visible = true;<BR> }<BR> else<BR> {<BR> this.dlcomment.Controls[i].FindControl("lkbUpdate").Visible = false;<BR> this.dlcomment.Controls[i].FindControl("lkbDel").Visible = false;<BR> }<BR> }<BR> this.dlcomment.DataBind();<BR> }</P>
<P>但是老是报错 </P>
<P><EM>指定的参数已超出有效值的范围。<BR>参数名: index</EM> </P>
<P>这该么样解决啊?!</P>
<P>请遇到过此问题的高人指点指点!</P>
<P><BR> </P>