GridView中添加 TemplateField ,TemplateField里边添加Linkbutton .
<asp:TemplateField ItemStyle-Width="10px">
<ItemTemplate>
<asp:Button ID="asp_btnUpdate" runat="server" Text="修改" CommandName="Modify" CommandArgument='<%# Eval("USER_NO")%>'/>
</ItemTemplate>
</asp:TemplateField>
protected void asp_gridViewSIMList_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
switch (e.CommandName)
{
case "Modify":
string user_No = e.CommandArgument.ToString();
GridViewRow row = (GridViewRow)(((Button)e.CommandSource).NamingContainer);
break;
default:
break;
}
}
}
你自己找找看哪里不对吧,代码都给你贴出来了