Last post Dec 02, 2011 12:47 AM by Mamba Dai - MSFT
Nov 25, 2011 01:16 PM|VBJunkie|LINK
I'm having an issue with ViewState working on a user's pc. Does anyone know any issue that would could ViewState not wto work on a pc?
The viewstate value is populated from the database after postback.
Could it be an IE version issue? Everything is working fine on my PC which is using IE7.
I'm using the following ViewState property below:
Public Property CustomDate() As Boolean
If ViewState("MultipleDate") Is Nothing Then
Set(ByVal Value As Boolean)
ViewState("MultipleDate") = Value
Nov 25, 2011 02:26 PM|sreejukg|LINK
Viewstate behaviour is not depends on the client browser, so what ever the browser it should work.
can you specify the error, double check your application logic....
Nov 25, 2011 03:02 PM|VBJunkie|LINK
When the page loads, a function is called to populate all of the fields on the page with values from the database. I have a line of code that sets the value of the property inside of the function depending on what value is contained in a dataset.
If drDates("date_id") = "3" Then
Me.CustomDate = True
The code above should set the boolean value to True. The next time the user clicks the save button, this value is checked to determine if an insert or update is required. If the value is equal to True, an update should be performed. This process works
on my pc but is always set to false on another user's pc. As a result, inserts are always performed.
Nov 25, 2011 05:29 PM|mbanavige|LINK
Perhaps that other user has adjusted their local browsers page cache settings and so they are posting an old copy of the page from their cache?
Have them completely clear their local browsers cache and try it again to see if this might be the case.
Nov 28, 2011 10:05 AM|VBJunkie|LINK
I've cleared the cache but I'm still experiencing the same issue. IE settings are set to automatically check for newer versions of a web page. Is there anything else I should check?
Nov 28, 2011 11:54 AM|VBJunkie|LINK
The user has forms checked for an autocomplete option in IE 7. Could this cause problems with viewstate?
Nov 28, 2011 12:09 PM|prabodhm|LINK
I have not faced Viewstate related issues in any version of IE.
Have to changed the location of Viewstate to store it in some other location (Session?) instead of the page (default) by implementing SessionStatePersister?
Dec 02, 2011 12:47 AM|Mamba Dai - MSFT|LINK
ViewState's execution doesn't reply on client browser. I have checked your source code, it's ok. Maybe the reason why ViewState doesn't wokr is that you have disabled the ViewState:
View state is enabled by default, but some controls on a page might not need view state. For example, if a control is refreshed from the data store on each postback, you can turn view state off for that control in order to reduce the size of view state.
You can configure controls so that view state is disabled by default for all controls within a page or a container control, and you can then enable view state for specific controls. You can also configure controls so that view state is disabled and cannot
be enabled for child controls.
To disable view state for a control by default so that it can be enabled for child controls, set the
ViewStateMode property of the control to Disabled. To disable view state by default for an entire page, set the
ViewStateMode attribute of the @ Page directive to
To disable view state for a control and its children so that it cannot be enabled for child controls, set the
EnableViewState property of the control to false. To disable view state for an entire page and all of its child controls, set the
EnableViewState attribute of the @ Page directive to