How do I save viewstate programmatically?

R

RHIZOME

I am reparameterizing a SqlDataSource programmatically, using runtime
events. This works nicely for on-the-fly search, but sorting and
paging are using the original (declared) version of my SqlDataSource.
The net effect is that I lose all of my runtime parameters, when I sort
or page in a GridView thats bound to my SqlDataSource. The
SqlDataSource reverts to its original viewstate from when the page
first loaded, when a user clicks a sort or paging link. I've tried to
invoke SavePageStateToPersistenceMedium, but since its protected, this
doesn't work from my page's codebehind scope. I've seen recipes for
overriding it and implementing your own persistence strategy. This
seems beyond my present need, which is just to ensure that my
SqlDataSource is current within viewstate, so that its sorted and paged
data reflects the most current state. Any easy way to do this?
 
T

Teemu Keiski

How about then overriding just LoadViewState and SaveViewState methods as
they concenrn only saving and loading the state, not the persistence medium?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,218
Latest member
JolieDenha

Latest Threads

Top