Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear Web Form after its been processed

Status
Not open for further replies.

IndyGill

Technical User
Jan 15, 2001
191
GB
Hi

I have a web form which sends a CDONTS email, once the form is processed it sends the email and then I set a Label1 to say "thank Your request has been processed" on teh same page

However, the values that the user enetered are still visable on the form. I was just wondering is there is there a method in asp.net I can use to clear the text in the form.

I thought I could use something like:

IfIsPost then
txtName.text = ""
End If

However this causes a required field validation error.

Thanks in adavance
 
I'm very new to this but I think it has to do with the View State of the page.
 
What I have done in this case is to make a void function that manually clears each feild on the form

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
I have disabled view state but this did not reolve it

How would you manually clear the textbox? as there isnt a command by where I can write

txtName.clear

I tried to use

txtName = ""

but this causes problems with the page validation when it posts the page back





 
If you just set EnableViewState=false

on each of your controls, then they will reset themselves on PostBack.

-paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top