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. Postback issue

Postback issue

Scheduled Pinned Locked Moved ASP.NET
csshelp
11 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.
  • R Offline
    R Offline
    rakeshs312
    wrote on last edited by
    #1

    I Have a gridview . When i click one of the files in the gridview , it will display the file details in a table in the grid.But if i am in 20th or 19th page of the gridview, after clicking on the file , the grid is comming to page 1. Is there any property for the grid to prevent this.

    A C 2 Replies Last reply
    0
    • R rakeshs312

      I Have a gridview . When i click one of the files in the gridview , it will display the file details in a table in the grid.But if i am in 20th or 19th page of the gridview, after clicking on the file , the grid is comming to page 1. Is there any property for the grid to prevent this.

      A Offline
      A Offline
      AmitGajjar
      wrote on last edited by
      #2

      Basically Viewstate maintain all this information about current page of the grid. check if it is not disabled for you. another way is, you can also store page number in the session and update only when next,previous ,first, last button click or grid is refresh. hope this will help you.

      Thanks -Amit Gajjar (MinterProject)

      R N 2 Replies Last reply
      0
      • A AmitGajjar

        Basically Viewstate maintain all this information about current page of the grid. check if it is not disabled for you. another way is, you can also store page number in the session and update only when next,previous ,first, last button click or grid is refresh. hope this will help you.

        Thanks -Amit Gajjar (MinterProject)

        R Offline
        R Offline
        rakeshs312
        wrote on last edited by
        #3

        thanks

        1 Reply Last reply
        0
        • A AmitGajjar

          Basically Viewstate maintain all this information about current page of the grid. check if it is not disabled for you. another way is, you can also store page number in the session and update only when next,previous ,first, last button click or grid is refresh. hope this will help you.

          Thanks -Amit Gajjar (MinterProject)

          N Offline
          N Offline
          n podbielski
          wrote on last edited by
          #4

          Never ever do that. I did twice and 2 diffrent apps and it was always mistake to store anything in session besides some user data valid to user not for some page. For example in one grid there was date filter. Stored in session and empty this caused app to crash in that particular page.

          No more Mister Nice Guy... >: |

          A 1 Reply Last reply
          0
          • N n podbielski

            Never ever do that. I did twice and 2 diffrent apps and it was always mistake to store anything in session besides some user data valid to user not for some page. For example in one grid there was date filter. Stored in session and empty this caused app to crash in that particular page.

            No more Mister Nice Guy... >: |

            A Offline
            A Offline
            AmitGajjar
            wrote on last edited by
            #5

            As i said that, session is not preferable. but it is an alternative. from each and every scenario we need to check if page number is updated correctly.

            Thanks -Amit Gajjar (MinterProject)

            N 1 Reply Last reply
            0
            • A AmitGajjar

              As i said that, session is not preferable. but it is an alternative. from each and every scenario we need to check if page number is updated correctly.

              Thanks -Amit Gajjar (MinterProject)

              N Offline
              N Offline
              n podbielski
              wrote on last edited by
              #6

              Why not control state? It suppose to work even with view state disabled. Or hidden field? In that way page will be set to one in case of page refresh as user would expect.

              No more Mister Nice Guy... >: |

              A 1 Reply Last reply
              0
              • N n podbielski

                Why not control state? It suppose to work even with view state disabled. Or hidden field? In that way page will be set to one in case of page refresh as user would expect.

                No more Mister Nice Guy... >: |

                A Offline
                A Offline
                AmitGajjar
                wrote on last edited by
                #7

                Disable the viewstate and change the grid page. it will not work.

                Thanks -Amit Gajjar (MinterProject)

                N 1 Reply Last reply
                0
                • A AmitGajjar

                  Disable the viewstate and change the grid page. it will not work.

                  Thanks -Amit Gajjar (MinterProject)

                  N Offline
                  N Offline
                  n podbielski
                  wrote on last edited by
                  #8

                  So why even bother to use something else then view state?

                  No more Mister Nice Guy... >: |

                  A 1 Reply Last reply
                  0
                  • N n podbielski

                    So why even bother to use something else then view state?

                    No more Mister Nice Guy... >: |

                    A Offline
                    A Offline
                    AmitGajjar
                    wrote on last edited by
                    #9

                    That's what i said in my answer. if it is disabled, then paging will not work.

                    Thanks -Amit Gajjar (MinterProject)

                    N 1 Reply Last reply
                    0
                    • A AmitGajjar

                      That's what i said in my answer. if it is disabled, then paging will not work.

                      Thanks -Amit Gajjar (MinterProject)

                      N Offline
                      N Offline
                      n podbielski
                      wrote on last edited by
                      #10

                      Ok. So this discusion is pointless. Take care :)

                      No more Mister Nice Guy... >: |

                      1 Reply Last reply
                      0
                      • R rakeshs312

                        I Have a gridview . When i click one of the files in the gridview , it will display the file details in a table in the grid.But if i am in 20th or 19th page of the gridview, after clicking on the file , the grid is comming to page 1. Is there any property for the grid to prevent this.

                        C Offline
                        C Offline
                        CommDev
                        wrote on last edited by
                        #11

                        Hi, I think you can try to record the page index (a hidden controls or others), and in your click event, the gridview should turn to that page first.

                        Comm100 - Leading Live Chat Software Provider

                        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