我的获取了 怎么就是取不到值呢 ?请大家帮忙看下
string cmd = e.CommandName;
int index = Convert.ToInt32(e.CommandArgument);
//int row = this.GridView1.Rows[index].RowIndex;
//int Id = int.Parse(this.GridView1.DataKeys[row].Value.ToString());
int Id = int.Parse(this.GridView1.DataKeys[index].Value.ToString());
if (cmd == "canelEdit")
{
TwoHandInfoInfo UsedInfo = UsedBLL.GetInfoById(Id);
UsedInfo.Td_State = "取消";
int result = UsedBLL.UpdateUsedInfo(UsedInfo);
if (result > 0)
{
Response.Redirect("~/UsedInfo/MyAssert.aspx?type=all");
}
else {
Response.Write("<script>alert('更改失败,请重新更改!')</script>");
Response.Redirect("~/UsedInfo/MyAssert.aspx?type=all");
}
}
string cmd = e.CommandName;
int index = Convert.ToInt32(e.CommandArgument);
//int row = this.GridView1.Rows[index].RowIndex;
//int Id = int.Parse(this.GridView1.DataKeys[row].Value.ToString());
int Id = int.Parse(this.GridView1.DataKeys[index].Value.ToString());
if (cmd == "canelEdit")
{
TwoHandInfoInfo UsedInfo = UsedBLL.GetInfoById(Id);
UsedInfo.Td_State = "取消";
int result = UsedBLL.UpdateUsedInfo(UsedInfo);
if (result > 0)
{
Response.Redirect("~/UsedInfo/MyAssert.aspx?type=all");
}
else {
Response.Write("<script>alert('更改失败,请重新更改!')</script>");
Response.Redirect("~/UsedInfo/MyAssert.aspx?type=all");
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货