HTML has the type of input buttons to reset all the form fields to their original state in one step: <input type="reset" ... />.
Is there a similar easy way to reset all form fields of an aspx page form from code? Or is it necessary that reset all control one by one with help TextBox1.Text=string.Empty, TextBox2.Text=string.Emptyetc.?
Thanks in advance!
Update:
Context is a simple contact page / "Send us a message" with 8 asp: TextBoxes on the page (where the user enters a name, address, phone, email, message, etc.). Then he clicks the โSendโ button, the encoded Onclick message processor sends an email to some administrator, and all the fields of the form filled in by the user must be emptied, and he receives a notification on the shortcut (โMessage sent by blabla ...โ)). I want the form fields to be cleared so that the user doesnโt click again to submit, and the same message is sent a second time.
source
share