Results 1 to 6 of 6

Thread: Clear Control's Viewstate

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Location
    Europe, Lithuania
    Posts
    309

    Clear Control's Viewstate

    Hey,

    How to clear ALL viewstate?
    I mean, not only item, that I added manualy, but all control's states.

    Etc. I press "Register" button in large registration form. I do not want go thought every control and set it to previous passition.

    PS. I can't simply reload page, becourse I output text (status of registration) on button click.

  2. #2
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    Van you not just set Viewstate to = false ???

    Parksie

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Location
    Europe, Lithuania
    Posts
    309
    Becource viewstate is needed for other controls, while user fills registration form.

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Well there is a Page.ViewState.Clear you can use.

    That of course clears viewstate for the entire page, I am a little unsure if it actually clear the page's children's viewstate. You'd have to test that.

    But what you can do is iterate the controls of the page, calling its me.viewstate.clear

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Location
    Europe, Lithuania
    Posts
    309
    It didn't work for me.
    Protected and Readonly...

  6. #6
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    did you try:

    VB Code:
    1. me.page.clearchildviewstate

    ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width