public ActionResult Index() { using (Repository <ProductEntity> rep = new RepositoryProduct()) { return(View(rep.GetAll().ToList())); } }
protected void Page_Load(object sender, EventArgs e) { Page.Title = "View Product Page"; if (Session["UserName"] == null) { Response.Redirect("../HomePage.aspx"); } _allproduct.DataSource = RepositoryProduct.GetAll(); _allproduct.DataBind(); }
private void refresh() { _allproduct.DataSource = RepositoryProduct.GetAll(); _allproduct.DataBind(); }