- C# code
if (!IsPostBack) { cb_selAll.Attributes.Add("onclick", "cb('cb_selAll')");//添加全选功能 //设置页面显示 pageSet.RepeaterPageLoad(myDs, lbl_Pagesize, lbl_PageMessage, lnkbtn_First, lbtnPrevious, lbtnNext, lnkbtn_Last, rpt); int uid = Convert.ToInt32(myCookie.getUserID()); if (Request["creatorID"] != null) { for (int i = 0; i < myDs.Tables[0].Rows.Count; i++) { int creator = Convert.ToInt32(Request["creatorID"]); if (creator != uid) { rpt.Items[i].FindControl("HyperLink7").Visible = false;//索引超出范围。必须为非负值并小于集合大小。参数名: index } } } //设置权限 pageSet.setPageLimite(myCookie.getRoleIds(), LimitID, "cb_id", "HyperLink7", rpt, tab_Edit); }
------解决方案--------------------------------------------------------
打断点看看,是不是rpt.Items的数目比myDs.Tables[0].Rows.Count小?
------解决方案--------------------------------------------------------
rpt里没ds那么多项把,
------解决方案--------------------------------------------------------
++
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------