protected void UserView_RowCommand(object sender,GridViewCommandEventArgs e)
{
///获取参数
string commandName = e.CommandName;
string cmd = " ";
cmd = e.CommandArgument.ToString();
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow gvr = UserGridView.Rows[index];
ListItem item = new ListItem();
item.Text = Server.HtmlDecode(gvr.Cells[4].Text);
///创建User实例
IUser user = new User();
switch(commandName)
{
case "Delete ":
{
///删除选择的用户
user.DeleteUser( " ");
///重新绑定GridView的数据
Response.Write( " <script> alert( ' " + "删除用户成功,请检查数据库是否吻合!!! " + " '); </script> ");
BindUserData();
break;
}
default:
break;
}
}
是不是还要在什么地方对(e.CommandArgument赋值呢
------解决方案--------------------------------------------------------
在2003里面,在html里给你的按钮加上CommandArgument就可以了
2005没有用过,不知道呢,你试下吧