Retrieve your primary key value in Session varaibles and then write the following code in updatebtn_click
Protected void updatebtn_Click(object sender, EventArgs e)
{
SqlCommand cmd= new SqlCommand("Update TableName Set Column1=@Column1,Column2=@Column2 Where ID=@ID",Conn);
cmd.Parameters.AddWithValue("@Column1",TextBox1.Text);
cmd.Parameters.AddWithValue("@Column2",TextBox2.Text);
cmd.Parameters.AddWithValue("@ID",txtid.Text);
try
{
Conn.open();
cmd.ExecuteNonQuery();
Conn.close();
}
Catch(Exception exp)
{
throw exp;
}
}
Hope, It will help you.
Thanks