protected void gvDividendPaidA_PageIndexChanging(object sender, GridViewPageEventArgs e) { //page index changing -- gridview for paid attraction gvDividendPendingA.PageIndex = e.NewPageIndex; List <Dividend> dvPaidList = DividendDB.getAllAttractionPaidDividendsByID(((Attraction)Session["userAttraction"]).AttractionID.ToString()); gvDividendPaidA.DataSource = dvPaidList; gvDividendPaidA.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { //use try and catch if the session is null try { //to show the dividend pending list List <Dividend> dvPendingList = DividendDB.getAllAttractionPendingDividendsByID(((Attraction)Session["userAttraction"]).AttractionID.ToString()); gvDividendPendingA.DataSource = dvPendingList; gvDividendPendingA.DataBind(); //to show the dividend paid list List <Dividend> dvPaidList = DividendDB.getAllAttractionPaidDividendsByID(((Attraction)Session["userAttraction"]).AttractionID.ToString()); gvDividendPaidA.DataSource = dvPaidList; gvDividendPaidA.DataBind(); } catch (Exception ex) { } }