views:

31

answers:

1

I'm using the asp.net PreviousPage functionality and cross-page postback. The problem i'm running into is that if I have any postbacks on my page, the PreviousPage information seems to be lost. I don't want to put it in ViewState because that will be quite large. I've thought about Session, but I don't want the data to persist after i've moved on to another page, and I really don't like the idea of putting code in all my other pages to delete old session variables.

What methods do you use to retain this sort of information that was passed in via cross-page postback?

UPDATE:

Most of the answers to questions raised about refreshing the page mention using Response.Redirect. I can't use this because it will cause a Get rather than reposting the informaiton that was posted to the page via cross-page postback, resulting in a loss of this information and preventing me from pupulating my controls with the selection criteria of the previous page.

I need to update the data in the grid while retaining the postback information. I thought about using AJAX, but that's not really an acceptable solution right now per customer requirements. I need to click a button and refresh the page as if it was newly posted, and i don't really see a way to re-submit a postback short of F5 and then clicking the dialog to accept reposting of data.

A: 

Store the previous page's values in the ViewState on the initial page load.

TheGeekYouNeed
I said I don't want to store it in viewstate, because it's a lot of data. That wil create a gigantic viewstate that must be sent to the user and back.
Mystere Man
sorry, i didn't read that sentence in the first paragraph. I would create a Session object, then, then destroy it when you're done with it. It doesn't have to persist throughout the rest of your app.
TheGeekYouNeed
Not really the answer i'm looking for, but nobody else is suggesting anything... so you get the answer.
Mystere Man