How to clear Viewstate in aspx (or ascx) page

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.
 
T

Teemu Keiski

Hi,

you can try:

Page's own ViewState collection ViewState.Clear()

And for child controls call: ClearChildViewState()
 
G

Guest

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

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top