protected void btnDelete_Click(object sender, EventArgs e) { if (Session["BranchPKID"].ToString() != "" && long.TryParse(Session["BranchPKID"].ToString(), out _PKID)) { _PKID = long.Parse(Session["BranchPKID"].ToString()); _branch = new BranchClass(_PKID); _branch.deleteRecord(_PKID); Session["BranchPKID"] = ""; } fillGridView(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["BranchPKID"].ToString() != "" && long.TryParse(Session["BranchPKID"].ToString(), out _PKID)) { _PKID = long.Parse(Session["BranchPKID"].ToString()); _branch = new BranchClass(_PKID); if (!Page.IsPostBack) { displayRecord(); } } else { _branch = new BranchClass(); } }