<asp:BoundField DataField="card" HeaderText="身份证号" SortExpression="card">
<ItemStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_item" Width="70px"/>
<HeaderStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_title" Width="70px" Height="30px" />
</asp:BoundField>
<asp:BoundField DataField="Flags" HeaderText="状态" SortExpression="Flags">
<ItemStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_item" Width="70px"/>
<HeaderStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_title" Width="70px" Height="30px" />
</asp:BoundField>
我只是在页面加了身份证那一列,导致下列错误,不加运行正常
错误如下:捕捉到 System.ArgumentOutOfRangeException
Message=指定的参数已超出有效值的范围。
参数名: index
Source=System.Web
ParamName=index
StackTrace:
在 System.Web.UI.ControlCollection.get_Item(Int32 index)
在 server_behind_Default2.GridView1_RowDataBound(Object sender, GridViewRowEventArgs e) 位置 f:\项目文件\server_behind\Account_stolen_Check.aspx.cs:行号 206
在 System.Web.UI.WebControls.GridView.OnRowDataBound(GridViewRowEventArgs e)
在 System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource)
在 System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
在 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
在 System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data)
在 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
在 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
在 System.Web.UI.WebControls.DataBoundControl.PerformSelect()
在 System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
在 System.Web.UI.WebControls.GridView.DataBind()
在 server_behind_Default2.bind(String type, String checktype) 位置 f:\项目文件\server_behind\Account_stolen_Check.aspx.cs:行号 116
InnerException:
<ItemStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_item" Width="70px"/>
<HeaderStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_title" Width="70px" Height="30px" />
</asp:BoundField>
<asp:BoundField DataField="Flags" HeaderText="状态" SortExpression="Flags">
<ItemStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_item" Width="70px"/>
<HeaderStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" CssClass="GridView_title" Width="70px" Height="30px" />
</asp:BoundField>
我只是在页面加了身份证那一列,导致下列错误,不加运行正常
错误如下:捕捉到 System.ArgumentOutOfRangeException
Message=指定的参数已超出有效值的范围。
参数名: index
Source=System.Web
ParamName=index
StackTrace:
在 System.Web.UI.ControlCollection.get_Item(Int32 index)
在 server_behind_Default2.GridView1_RowDataBound(Object sender, GridViewRowEventArgs e) 位置 f:\项目文件\server_behind\Account_stolen_Check.aspx.cs:行号 206
在 System.Web.UI.WebControls.GridView.OnRowDataBound(GridViewRowEventArgs e)
在 System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource)
在 System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
在 System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
在 System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data)
在 System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
在 System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
在 System.Web.UI.WebControls.DataBoundControl.PerformSelect()
在 System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
在 System.Web.UI.WebControls.GridView.DataBind()
在 server_behind_Default2.bind(String type, String checktype) 位置 f:\项目文件\server_behind\Account_stolen_Check.aspx.cs:行号 116
InnerException:
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货