protected void DataList1_ItemCommand(object sender, DataListCommandEventArgs e)
{
DataList1.SelectedIndex = e.Item.ItemIndex;
string id=DataList1.DataKeys[e.Item.ItemIndex ].ToString ();
Response.Redirect("shownews.aspx?id='"+id+"'");
}
当用DataKeys获取主键时有“索引超出范围。必须为非负值并小于集合大小。
参数名: index”的错误,高手们能告诉我为什么吗?
{
DataList1.SelectedIndex = e.Item.ItemIndex;
string id=DataList1.DataKeys[e.Item.ItemIndex ].ToString ();
Response.Redirect("shownews.aspx?id='"+id+"'");
}
当用DataKeys获取主键时有“索引超出范围。必须为非负值并小于集合大小。
参数名: index”的错误,高手们能告诉我为什么吗?
解决方案 »
- System.FormatException - GUID 应包含带 4 个短划线的 32 位数()
- 未将对象引用设置到对象的实例。
- 哪里可以找到补丁,让VS2003 编辑器不再"修改"我的HTML源代码?
- 请问,如何在vs2005中直接调试c#程序,正在看c#
- 网页里能打开 AutoCAD 吗?
- DATETIME的小问题。谁帮帮我。我是新手。
- 一句话可以解决的问题 关于LABEL
- 好郁闷,为什么还是不能解决?^?^?^?^(谁能正确回答,给全分)
- 【急】后台怎么处理JSON数据中含有双引号??
- 新手 求教 急急急
- 请大家帮忙看看!关于Asp在线考试系统的计时问题,到时间后自动交卷
- 对路径“D:\****\Systemlog.log”的访问被拒绝的解决
string id = GridView.DataKeys[e.RowIndex].Value.ToString();