you need to add the given tag on your page.
<asp:toolkitscriptmanager id="toolScript1" runat="server" xmlns:asp="#unknown"></asp:toolkitscriptmanager>
and then you have to write the following code in
protected void btnEdit_Click(object sender, ImageClickEventArgs e)
{
ImageButton btndetails = sender as ImageButton;
GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer;
txtSNo = grv.DataKeys[gvrow.RowIndex].Value.ToString();
txtCurName.Text = gvrow.Cells[2].Text;
txtCurCode.Text = gvrow.Cells[3].Text;
txtCurSymbol.Text = gvrow.Cells[4].Text;
this.ModalPopupExtender1.Show();
}
hope, it will help you.
Best of Luck