protected void lkbEditDepartment_Click(object sender, EventArgs e) { MasterEntries objMasterEntry = new MasterEntries(); LinkButton b = (LinkButton)sender; int Id = Convert.ToInt32(b.CommandArgument); string departmentName = objMasterEntry.GetDepartmentById(Id); txtEditDepartment.Text = departmentName; Session["departmentId"] = Id; popupEditDepartment.Show(); }