Using OnCommand in Button
.aspx page
--------------
<asp:ImageButton ID="img01" runat="server" ImageUrl="~/Images/edit_j_btn.jpg" OnCommand="onEdit_Click" CommandArgument='<%#Eval("UserId") %>' />
code behind
--------------
public void onEdit_Click(object sender,System.Web.UI.WebControls.CommandEventArgs e)
{
int userid= Convert.ToInt32(e.CommandArgument);
Response.Redirect("Home.aspx?_UserId=" + userid);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment