tags:

views:

115

answers:

4

Hi, I am using Multiview. And I am switching between views. Each view contains lots of fields. I am going to another view from the current view to add some data. And after adding data from the new view, I am returning to the previous view. Now on this view I want to populate fields which I have entered before switching. Currently I am using ViewState to retain previous values. But this costs lot as there are lots of fields on a single view. Is there any other way to do this task?

+1  A: 

You can store those values in a temporary table otherwise i dont think there is any problem with Viewstate.. better make a structure, store your values in that structure and store the structure in one viewstates...

Samiksha
+3  A: 

This isn't too far off from what viewstate is designed for--I'd stick with that.

Other less-desirable alternatives include sessions, database tables, and httpcontext.

Michael Haren
A: 

Another possiblity is to use the Server.Transfer("url", true) which allows you to pass the previous form along with the data that was contained in the form to the next page.

Check out http://www.developer.com/net/asp/article.php/3299641 for usage examples.

Chris Marisic
A: 

If your ViewState is getting big, consider compressing it:

You can also shrink your server-to-client payload with HTTP compression. The client will POST the ViewState uncompressed so ViewState compression could still be valuable.

Corbin March