protected void btn_undoClickEvent(object sender, EventArgs e) { if (Session["recentAddedQuotes"] != null) { var listQuotes = Session["recentAddedQuotes"] as List <DeltoneCRM_DAL.QuoteDAL.QuoteAssignOne>; var qtDal = new QuoteDAL(CONNSTRING); var repId = Convert.ToInt32(RepNameDropDownList.SelectedValue); if (repId > 0) { qtDal.DeleteQuoteRecentAllocate(listQuotes, repId); Session["recentAddedQuotes"] = null; undoButton.Visible = false; messagelable.Text = "Successfully Deleted."; } } }