protected void lkbEditDuration_Click(object sender, EventArgs e) { MasterEntries objMasterEntry = new MasterEntries(); LinkButton b = (LinkButton)sender; int Id = Convert.ToInt32(b.CommandArgument); TimeSpan editDuration = objMasterEntry.GetDurationById(Id); txtEditDuration.Text = editDuration.ToString(); Session["durationId"] = Id; popupEditDuration.Show(); }