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. Post back and grid view [modified]

Post back and grid view [modified]

Scheduled Pinned Locked Moved ASP.NET
cssdatabasehelp
2 Posts 2 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
    Masood Ahmed
    wrote on last edited by
    #1

    Hello All i h a gridview with paging i h also edit button when i click on edit button of row 2 of page 4 it return index number 1 but infaact index number in whole data set is index=4*7 (page size)+1 which mean 29 for this i h three variable name as page number page size and index number but problem is on post back all these variables shows zero value except index number which show one in this case to avoid this i used static variable which retain last value but on web static variable cause some problem becase these are shared variable pls tell me how i can retain values without being affected by post back also on post back data set get empty any solution Regards Masood

    M 1 Reply Last reply
    0
    • M Masood Ahmed

      Hello All i h a gridview with paging i h also edit button when i click on edit button of row 2 of page 4 it return index number 1 but infaact index number in whole data set is index=4*7 (page size)+1 which mean 29 for this i h three variable name as page number page size and index number but problem is on post back all these variables shows zero value except index number which show one in this case to avoid this i used static variable which retain last value but on web static variable cause some problem becase these are shared variable pls tell me how i can retain values without being affected by post back also on post back data set get empty any solution Regards Masood

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      What do you want to do with this index value? Do you want to use it to pick up the selected data row in the dataset? If so, you simply persist the id value using the DataKeyNames[^] property, and you can access the selected id from the DataKeys collection.

      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