protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int DonorID = Convert.ToInt32(Session["ID"].ToString()); RecordsDAO recordsDAO = new RecordsDAO(); DonationGrid.DataSource = recordsDAO.ShowList(DonorID); DonationGrid.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["userKey"] != null) { Community_AssistEntities db = new Community_AssistEntities(); int key = (int)Session["userKey"]; var don = (from d in db.Donations where d.PersonKey == key select d).ToList(); DonationGrid.DataSource = don; DonationGrid.DataBind(); } else { Response.Redirect("Default.aspx"); } }