Clear all fields on a screen

  • Thread starter Thread starter tshad
  • Start date Start date
T

tshad

Is there a way to tell a screen on Postback to clear all the objects (or put
them back to their defaults on Postback)?

At the moment, I am just going through and setting them manually before
reading new records.

Thanks,

Tom
 
you could just server.Transfer or response.redirect to the same page, that
would set everything back to the defaults.


HTH

cheers

Martin.
 
Martin said:
you could just server.Transfer or response.redirect to the same page, that
would set everything back to the defaults.

That is actually a good idea since I am going to PostBack anyway to clear
the fields and I wouldn't be sending back the data that is in the viewstate
tag.

The reason I would typically do this is because the use has selected a new
record and I am repopulating the screen, so I could pass his choice to the
redirection.

The only thing would be that I would then need to re-read the data in a
couple of dropdowns when I did this, but that is probably outweighed by the
viewstate.

Thanks,

Tom
 
Back
Top