索引超出范围
if (this.gridOrderStat.SelectedItems.Count == 0)
{
this.JSUtil.Alert("请选择记录!");
}
else
{
GridItem gi = this.gridOrderStat.SelectedItems[0];
string url = "../../OrderPackage/OrderAdjustDetail.aspx?OrderID=" + gi["OrderID"].ToString() + "&OrderType=" + gi["OrderType"].ToString() + "&ShipToPartyID=" + gi["ShipToPartyID"].ToString() + "&SendInvoiceInfoID=" + gi["SendInvoiceInfoID"].ToString() + "&SoldToPartyID=" + gi["SoldToPartyID"].ToString() + "&SOCode=" + gi["SOCode"].ToString() + "&POCode=" + gi["POCode"].ToString();
url += "&ReturnURL=OrderAdjust.aspx";
Response.Redirect(url);
}
麻烦大家帮忙看看这段代码有什么错误?一运行就报索引超出范围!
------解决方案--------------------GridItem gi = this.gridOrderStat.SelectedItems[0];
gi没有获取到值吧
------解决方案-------------------- Make sure all your column are exists.
Such as
OrderID ,OrderType ,POCode etc...
------解决方案--------------------运行就报索引超出范围
..很明显 gi 为空 木有值, 你断点 看看 gi 有值么
------解决方案--------------------将你的asp控件改成html控件,然后通过onclientclick时间来获取就ok拉