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. How to write code on Next and Prev. Buttons

How to write code on Next and Prev. Buttons

Scheduled Pinned Locked Moved ASP.NET
tutorial
4 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.
  • S Offline
    S Offline
    sjs4u
    wrote on last edited by
    #1

    Hi, I am feching the records from arraylist using datarow. One by One record fetch and stored it into the varibles. Now I have 2 buttons one is Next and other is Prev. I want to circulate the records by using the Next and Prev buttons. on the Next button when click Next record will be display on the form and on the Prev button Previous record will be display. I have 10 records in the arraylist. It is like online exam paper. Thanks, sjs4u

    S S 2 Replies Last reply
    0
    • S sjs4u

      Hi, I am feching the records from arraylist using datarow. One by One record fetch and stored it into the varibles. Now I have 2 buttons one is Next and other is Prev. I want to circulate the records by using the Next and Prev buttons. on the Next button when click Next record will be display on the form and on the Prev button Previous record will be display. I have 10 records in the arraylist. It is like online exam paper. Thanks, sjs4u

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      Are you using any control to show the records like repeater,Gridview ? If no then just create a session varaible, store the index of the reacord that you are showing when you click next increment that index by one and when say Prev decrement that record by one and fetch the record from your arraylist.Also check lower and upper bound of your arraylist

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      S 1 Reply Last reply
      0
      • S sjs4u

        Hi, I am feching the records from arraylist using datarow. One by One record fetch and stored it into the varibles. Now I have 2 buttons one is Next and other is Prev. I want to circulate the records by using the Next and Prev buttons. on the Next button when click Next record will be display on the form and on the Prev button Previous record will be display. I have 10 records in the arraylist. It is like online exam paper. Thanks, sjs4u

        S Offline
        S Offline
        sathish s
        wrote on last edited by
        #3

        You can use a currency manager to navigate between records both ways within array list http://support.microsoft.com/kb/316303[^] For an incremental navigation you can use arraylist.Getenumerator method and enumerator.Movenext

        1 Reply Last reply
        0
        • S Sandeep Akhare

          Are you using any control to show the records like repeater,Gridview ? If no then just create a session varaible, store the index of the reacord that you are showing when you click next increment that index by one and when say Prev decrement that record by one and fetch the record from your arraylist.Also check lower and upper bound of your arraylist

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          S Offline
          S Offline
          sjs4u
          wrote on last edited by
          #4

          Thanks Sandeep for a wonderfull solution. Regards, Sandeep

          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