Beispiel #1
0
    private void bindProduct()
    {
        dt = objProduct.GetProductOnSale(0);
        //  dt = objProduct.GetProductBySubCategoryID(Convert.ToInt32(Request.QueryString["scid"]), true);

        ///  DataTable dt2 = new DataTable();
        // dt2 = objSubCategory.GetSubCategory(Convert.ToInt32(Request.QueryString["scid"]));


        //if (dt2.Rows.Count > 0)
        //{
        //    ((HtmlTitle)Master.FindControl("_metaTitle")).Text = dt2.Rows[0]["MetaTitle"].ToString();
        //    ((HtmlMeta)Master.FindControl("_metaKeywords")).Attributes.Add("Content", dt2.Rows[0]["MetaKeyword"].ToString());
        //    ((HtmlMeta)Master.FindControl("_metaDescription")).Attributes.Add("Content", dt2.Rows[0]["MetaDescription"].ToString());
        //}



        if (dt.Rows.Count > 0)
        {
            _PagedDataSource.DataSource  = dt.DefaultView;
            _PagedDataSource.AllowPaging = true;
            _PagedDataSource.PageSize    = 8;
            if (currentPage >= 0)
            {
                _PagedDataSource.CurrentPageIndex = currentPage;
                ViewState["TotalPages"]           = _PagedDataSource.PageCount;
                this.btn_first.Enabled            = !_PagedDataSource.IsFirstPage;
                this.btn_last.Enabled             = !_PagedDataSource.IsFirstPage;
                this.btn_next.Enabled             = !_PagedDataSource.IsLastPage;
                this.btn_last.Enabled             = !_PagedDataSource.IsLastPage;

                repProducts.DataSource = _PagedDataSource;
                repProducts.DataBind();
                this.doPaging();
            }
        }
    }