private void RefreshData() { var data = imsdb.Sizes.OrderByDescending(br => br.Id).ToList(); GridViewSize.DataSource = data; GridViewSize.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["typeid"].ToString() != "2") { Response.Redirect("~/Login/Login.aspx"); } } catch (Exception) { Response.Redirect("~/Login/Login.aspx"); } if (!IsPostBack) { var data = imsdb.Sizes.OrderByDescending(b => b.Id).ToList(); GridViewSize.DataSource = data; GridViewSize.DataBind(); } }