Clear all fields on a screen

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
 
M

Martin

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


HTH

cheers

Martin.
 
T

tshad

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
 

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,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top