How to clear Viewstate in aspx (or ascx) page

  • Thread starter Thread starter asgars
  • Start date Start date
A

asgars

hi friends,
i am having an aspx page. i want to clear its viewstate on a particular
condition.
Is that possible? If yes, how can i do so?
Plz help me.
 
Hi,

you can try:

Page's own ViewState collection ViewState.Clear()

And for child controls call: ClearChildViewState()
 
To simply wipe the whole viewstate out and go back to a situation as if the
user just opened the page, i find that semding a resposne.redirect to the
page that you are on work quite well.
 

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

Back
Top