Exemplo n.º 1
0
    //refreshes datalist
    protected void PopulateDataList()
    {
        pg = new PagedDataSource();
        ds = Likes.GetLikesForUser(int.Parse(Session["id"].ToString()));
        if (ds.Tables[0].Rows.Count > 0)
        {
            pg.AllowPaging = true;
            pg.DataSource  = ds.Tables[0].DefaultView;

            pg.PageSize         = 5;
            pg.CurrentPageIndex = this.currentpage;
            this.ImageButtonNextPage.Enabled = !pg.IsLastPage;
            this.ImageButtonPrevPage.Enabled = !pg.IsFirstPage;
            DataList1.DataSource             = pg;
            DataList1.DataBind();
        }
        else
        {
            LabelLikes.Text = "You didn't like any audios :(";
        }
    }