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. ViewState Problem

ViewState Problem

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

    Hey all, I'm having this weird problem with an aspx page. In this page I have 2 dropDownList controls: _TableDropDown - has items that I entered at design time. the items are: Cities, Titles etc.. _RowsDropDown - filled after _TableDropDown is autoPostBack to server from DB(when selecting Cities of _TableDropDown the _RowsDropDown is filled with YNC, Paris etc.. and when selecting Titles of _TableDropDown the _RowsDropDown is filled with Manager, Developer etc...) everything is ok until I press the back button.:sigh: this is what I did from IE: 1. got the page the first time - the _TableDropDown with Cities and _RowsDropDown with the data from DB. 2. changed the _TableDropDown value to Titles - postback occured and the page got back to me with the right data. 3. press back button - now the _TableDropDown is set with Titles value BUT _RowsDropDown values filled with cities data.. I know that when pressing back button of IE there is NO postback to the server so I guessed it's something with the viewState... Is someone familier with the problem? What should I do to get over this?:(( Thank you very much, RoyRose

    C 1 Reply Last reply
    0
    • R RoyRose78

      Hey all, I'm having this weird problem with an aspx page. In this page I have 2 dropDownList controls: _TableDropDown - has items that I entered at design time. the items are: Cities, Titles etc.. _RowsDropDown - filled after _TableDropDown is autoPostBack to server from DB(when selecting Cities of _TableDropDown the _RowsDropDown is filled with YNC, Paris etc.. and when selecting Titles of _TableDropDown the _RowsDropDown is filled with Manager, Developer etc...) everything is ok until I press the back button.:sigh: this is what I did from IE: 1. got the page the first time - the _TableDropDown with Cities and _RowsDropDown with the data from DB. 2. changed the _TableDropDown value to Titles - postback occured and the page got back to me with the right data. 3. press back button - now the _TableDropDown is set with Titles value BUT _RowsDropDown values filled with cities data.. I know that when pressing back button of IE there is NO postback to the server so I guessed it's something with the viewState... Is someone familier with the problem? What should I do to get over this?:(( Thank you very much, RoyRose

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If there is no postback, then viewstate cannot have anything to do with it

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      R 1 Reply Last reply
      0
      • C Christian Graus

        If there is no postback, then viewstate cannot have anything to do with it

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

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

        There is no postback & it's find with me cause I don't need anything from the server. All I want is that when I press IE's back button it'll go to the state it was and not to an imposible state!

        C 1 Reply Last reply
        0
        • R RoyRose78

          There is no postback & it's find with me cause I don't need anything from the server. All I want is that when I press IE's back button it'll go to the state it was and not to an imposible state!

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          The way to do this, is to store the value in the URL, and to do a redirect to that URL, on postback. Otherwise, the step where you changed the value of one, but the other was not changed, is a page in IE's history. That's what you're stepping back to.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          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