如何修复Page_Load事件中的OutOfRangeException

时间:2019-06-27 07:55:12

标签: c# asp.net

我要在Page_load事件中设置中继器数据绑定。当我运行解决方案时,会出现运行时错误。

   [IndexOutOfRangeException: Index was outside the bounds of the array.]
   ASP.default_aspx.__DataBind__control3(Object sender, EventArgs e) +800
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +304
   System.Web.UI.Control.DataBindChildren() +12759559
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +321
   System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +183
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +659
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +164
   InfoShopping.Default.Page_Load(Object sender, EventArgs e) in E:\E\development\web development\InfoShopping\InfoShopping\InfoShopping\Default.aspx.cs:24
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

0 个答案:

没有答案