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”的错误,高手们能告诉我为什么吗?
解决方案 »
- 菜鸟提问:gridview的问题
- centos mono 运行ASP.NET MVC3模型验证的错误,请高手指点!
- C#操作WORD问题
- 为站点中文件夹“admin”中的文件配置不同的breadcrumd
- GridView如何合并相同內容
- 前几天把动网新闻传到支持ASP.NET空间上,不知道为什么,直接浏览的时候老出现问题
- 下载后出问题了
- 求关于asp.nat二级级联下拉菜单的做法
- 编译错误
- 如何在ASP.NET中实现像Excel中数据透视表和数据透视图那样的效果?
- 请大家帮忙看看!关于Asp在线考试系统的计时问题,到时间后自动交卷
- 对路径“D:\****\Systemlog.log”的访问被拒绝的解决
string id = GridView.DataKeys[e.RowIndex].Value.ToString();