Exemplo n.º 1
0
    //refreshes data list
    protected void PopulateDataList(int user_id)
    {
        pg = new PagedDataSource();
        ds = AudioFiles.GetAllFilesByUser(user_id);
        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
            LabelNoAudio.Text = "This user didn't upload any files :(";

    }