Groups | Blog | Home
all groups > asp.net building controls > march 2005 >

asp.net building controls : Changing viewstate on client


Paul K
3/16/2005 8:45:04 AM
I created a custom datagrid that works similarly to the new GridView control
(using the XML request/response objects to retrieve data in the background
for paging/sorting). Everything is working, but I want to streamline it a
little.

The biggest problem I've had is that the datagrid keeps it's current page
index in viewstate, and viewstate is essentially useless during a client
"callback" because the data in viewstate is out of sync with the events
coming in.

If I could update the viewstate on the client with a new viewstate from the
server, then I wouldn't have to jump through hoops just to get paging to work
- the viewstate would always be in sync with callbacks. I tried just getting
the viewstate in SavePageStateToPersistenceMedium and serializing it with the
LosFormatter class, but I get the "invalid viewstate" exception on any
subsequent calls.

I'm not looking to modify values inside of the viewstate on the client - I'm
looking to update the entire viewstate with a valid viewstate from the web
server.

joshmouch
4/5/2005 12:48:24 AM

I'd like to do the same thing. Did you find a solution yet?

Joshua Mouch
[url]http://www.willowtreeweb.com[/url]

[quoted text, click to view]


-
joshmouc
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------
J. Merrill
10/26/2005 8:37:06 AM
Two things. First, does anyone know why I am not seeing the question, when
using MS's web-based newsreader? How did the poster put the text in so that
it's not visible via the web?

Second, having not seen the exact question, I hope this extra info (besides
"you can't do that") helps:

What you probably should do is have the Javascript code (that was going to
change Viewstate if that were possible) put information into a hidden field;
during a postback, read that info and use it -- however you want to -- to
update the Viewstate.
--
J. Merrill / Analytical Software Corp.

[quoted text, click to view]
Anand Thurubatla
10/26/2005 10:59:21 AM

Updating viewstate at client-side is not possible. Because content o
viewstate is a long encoded string which can only be interpreted b
ASP.Net

--
Anand Thurubatl
-----------------------------------------------------------------------
Anand Thurubatla's Profile: http://www.highdots.com/forums/m120
View this thread: http://www.highdots.com/forums/t69395
AddThis Social Bookmark Button