gridview
make sure you using correct command name..
<asp:TemplateField HeaderStyle-Font-Bold="false" HeaderStyle-Font-Size="12px"
HeaderText="Edit"
ItemStyle-Font-Bold="false" ItemStyle-Font-
Size="12px" ItemStyle-Width="20px">
<ItemTemplate>
<asp:ImageButton ID="Editimg" CausesValidation="false" runat="server"
CommandName="Edit" Height="20px" ImageUrl="~/Images/edit.png"
Width="20px" />
</ItemTemplate>
<HeaderStyle Font-Bold="False" Font-Size="12px" />
<ItemStyle Font-Bold="False" Font-Size="12px"
Width="20px" />
</asp:TemplateField>
code behind...
if (e.CommandName == "Edit")
{
ImageButton Editimg = (ImageButton)e.CommandSource;
GridViewRow row = (GridViewRow)Editimg.NamingContainer;
TextBox1.Text = row.Cells[1].Text;
TextBox2.Text = row.Cells[2].Text;
}