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. General Programming
  3. C#
  4. Need to create next button

Need to create next button

Scheduled Pinned Locked Moved C#
csharpphpcomhelpquestion
5 Posts 4 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
    Member_16116393
    wrote on last edited by
    #1

    Hi everyone, I am new to this community and C# in general, (a PHP guy) but I am hoping I can get some help here. I am trying to have a page display 20 products then, a next button for the other 20 and so on. Below is the code of what I am trying to achieve. (link to image image_new_button.png - Google Drive[^] ) Thanks for your help in advance. Best regards

    <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="winners.aspx.cs" Inherits="FrontPanel.winners" %>

        #### Winner List 
    

    Product Details

    Amount

    User Details

                        <%#Eval("productname") %>
    

    <%#Eval("winamount") %>

    <%#Eval("username") %>

    L R 2 Replies Last reply
    0
    • M Member_16116393

      Hi everyone, I am new to this community and C# in general, (a PHP guy) but I am hoping I can get some help here. I am trying to have a page display 20 products then, a next button for the other 20 and so on. Below is the code of what I am trying to achieve. (link to image image_new_button.png - Google Drive[^] ) Thanks for your help in advance. Best regards

      <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="winners.aspx.cs" Inherits="FrontPanel.winners" %>

          #### Winner List 
      

      Product Details

      Amount

      User Details

                          <%#Eval("productname") %>
      

      <%#Eval("winamount") %>

      <%#Eval("username") %>

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I don't see you retrieving any. Usually, the question would be: How do I retrieve the "next" 20? Then, the "previous" 20. And so forth.

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      M 1 Reply Last reply
      0
      • L Lost User

        I don't see you retrieving any. Usually, the question would be: How do I retrieve the "next" 20? Then, the "previous" 20. And so forth.

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        M Offline
        M Offline
        Member_16116393
        wrote on last edited by
        #3

        Hi Gerry, Yes, it does retrieve info already as shown in the screenshot I linked, but it displays it all on a single page. This would cause a lengthy page and users would have to scroll to the bottom which can be never ending. I am looking for a solution to have it display only 20 items per page, with a next and previous button as previously mentioned. Thanks much

        D 1 Reply Last reply
        0
        • M Member_16116393

          Hi everyone, I am new to this community and C# in general, (a PHP guy) but I am hoping I can get some help here. I am trying to have a page display 20 products then, a next button for the other 20 and so on. Below is the code of what I am trying to achieve. (link to image image_new_button.png - Google Drive[^] ) Thanks for your help in advance. Best regards

          <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="winners.aspx.cs" Inherits="FrontPanel.winners" %>

              #### Winner List 
          

          Product Details

          Amount

          User Details

                              <%#Eval("productname") %>
          

          <%#Eval("winamount") %>

          <%#Eval("username") %>

          R Offline
          R Offline
          RedDk
          wrote on last edited by
          #4

          The plumbers are here and working in my apratment room so to pass the time I'v fired up my web browser and coming across your question, I'm prompted to provide a few links which might be helpful. One is at StackExchange and in this particular post there's another link which is to C# Corner. Check them out: https://stackoverflow.com/questions/4293805/how-to-show-20-rows-on-datagrid-each-time[^] Example of DataGrid in ASP.NET[^] And to top all this off, there's another link that comes full circle back to CP: Using ROW_NUMBER() to paginate your data with SQL Server 2005 and ASP.NET[^] What I seem to do when I use someone elses code is try anything that remotely resembles what I want to see happen ... but of course the example/sample's got to compile first!. That second C#Corner webpage even shows images of the expected output from the running. Perhaps too old that CP SQLServer suggestion but I've always had good luck fronting data with the various flavors of SQL and there's always a ton of it on SO.

          1 Reply Last reply
          0
          • M Member_16116393

            Hi Gerry, Yes, it does retrieve info already as shown in the screenshot I linked, but it displays it all on a single page. This would cause a lengthy page and users would have to scroll to the bottom which can be never ending. I am looking for a solution to have it display only 20 items per page, with a next and previous button as previously mentioned. Thanks much

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You didn't show the code that queries the database and returns it. I'm going to assume it's a simple query that returns everything in a table. You're basically going to have to completely re-write that code, and the code you posted, so it can track which page the user is on, and take parameters for what to return, like the number of items per page and which page to return. There's plenty of examples on the web for "ASP.NET database paging". All you have to do is search for that.

            Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles. Dave Kreskowiak

            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