Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Picture Gallery with paging

Picture Gallery with paging

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasequestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mehrdadc48
    wrote on last edited by
    #1

    Hi. Can anyone give me an idea about it : I want to make a picture gallery using ASP.Net2 (C#), that images are in DB. I want using a control that has paging feature. but Gridview is not sufficeint, because it has borders. how can do it?

    Best wishes

    K 1 Reply Last reply
    0
    • M mehrdadc48

      Hi. Can anyone give me an idea about it : I want to make a picture gallery using ASP.Net2 (C#), that images are in DB. I want using a control that has paging feature. but Gridview is not sufficeint, because it has borders. how can do it?

      Best wishes

      K Offline
      K Offline
      karanba
      wrote on last edited by
      #2

      Hi.. use PagedDataSource class. Here an example that shows how to use an asp:Repeater with paging next and previus page // After you get your data by using a DataAdapter fill a Dataset DataSet ds = new DataSet(); da.Fill(ds); // create an instance of PagedDataSource and give ds as datasource to it. PagedDataSource pds = new PagedDataSource(); pds.DataSource = ds; pds.AllowPaging = true; pds.PageSize = 10; // take curent page from QueryString and set CurrentPageIndex int CurPage; if (Request.QueryString["p"] != null) CurPage = Convert.ToInt32(Request.QueryString["p"]); else CurPage = 1; pds.CurrentPageIndex = CurPage-1; // bind pds to repeater and set link for next and prev links or you can simple make a loop and // write all page links down with using another repeater myRepeater.DataSource = pds; if (pds.Count > 0) { myRepeater.Visible = true; myRepeater.DataBind(); } if (!pds.IsFirstPage) lnkPrev.HRef = "news.aspx?p=" + Convert.ToString(CurPage - 1); if (!pds.IsLastPage) lnkNext.HRef = "news.aspx?p=" + Convert.ToString(CurPage + 1); if it is not clear you could ask for more..

      karanba

      K 1 Reply Last reply
      0
      • K karanba

        Hi.. use PagedDataSource class. Here an example that shows how to use an asp:Repeater with paging next and previus page // After you get your data by using a DataAdapter fill a Dataset DataSet ds = new DataSet(); da.Fill(ds); // create an instance of PagedDataSource and give ds as datasource to it. PagedDataSource pds = new PagedDataSource(); pds.DataSource = ds; pds.AllowPaging = true; pds.PageSize = 10; // take curent page from QueryString and set CurrentPageIndex int CurPage; if (Request.QueryString["p"] != null) CurPage = Convert.ToInt32(Request.QueryString["p"]); else CurPage = 1; pds.CurrentPageIndex = CurPage-1; // bind pds to repeater and set link for next and prev links or you can simple make a loop and // write all page links down with using another repeater myRepeater.DataSource = pds; if (pds.Count > 0) { myRepeater.Visible = true; myRepeater.DataBind(); } if (!pds.IsFirstPage) lnkPrev.HRef = "news.aspx?p=" + Convert.ToString(CurPage - 1); if (!pds.IsLastPage) lnkNext.HRef = "news.aspx?p=" + Convert.ToString(CurPage + 1); if it is not clear you could ask for more..

        karanba

        K Offline
        K Offline
        kumarrani555
        wrote on last edited by
        #3

        Hi karanba, I am not clear can you please send me a full code it is very urgent requirement. My mail id : briteindia_kumar@hotmail.com thanks and regards kumar

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups