protected void UpdatePanel1_Load(object sender, EventArgs e) { //Populate Orders grid Order order = new Order(); DataTable dataTable = order.ToDataTable(order.GetAllOrders()); GridViewOrders.DataSource = dataTable; GridViewOrders.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["UserID"] == null) Response.Redirect("~/Login.aspx"); else { Order ord = new Order(); HistoryGrid.DataSource = ord.ToDataTable(ord.GetAllOrdersByUserID(Convert.ToInt32(Session["UserID"]))); DataBind(); if (!Page.IsPostBack) { } } }