Results 1 to 2 of 2

Thread: ASP.NET form reset button

  1. #1
    Join Date
    Feb 2004

    ASP.NET form reset button

    is there a way to create a form reset button in ASP.NET that does not fire the validators?

    I tried creating a button that is set to CausesValidation = False, and runs a query which resets the form values to the original state. The result of this was that the validator message appeared briefly, and then disappeared when the form values were reset.

    Any ideas how to avoid this?



  2. #2
    Join Date
    Nov 2002
    Auburn, AL
    Actually, this is one time where I would use java script. No sence in having to resend the page if you are just changeing some text box content for the client. Also, about those form validators... I don't use them. I do my validations with an if statement before the code that needs to be fired is fired (case statement would would here too). I can control my output better this way. If you did this you would not need to worrie about fireing validators. Idealy you would check the form client side with javascript too before you run the server side form check so that you save the user and the server that burdon... just so long as you do check server side too though as a backup for those who do not have js.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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