How to suppress the effect of RequiredFieldValidator when clicking "Cancel" button?

Posted on 2006-03-29
Last Modified: 2012-08-14

I'm working on an ASP.NET web application. It is a web form that includes many web controls. Many of the TextBox have their own RequiredFieldValidators.

On this web page, there are 2 buttons: Submit and Cancel. I'd like to have the following effect: when clicking "Cancel", it is directed back to the homepage, e.g. index.html.

Assumed that the following scenario occurs: a user accesses this web page, e.g to register a profile. There is no data is entered at any textbox. The user now clicks on "Cancel" to go back to the home page.

However, the page is not directed back to the home page. Instead, red marks are placed beside all the empty textboxes - required to have inputs -. It seemed that the RequiredFieldValidators starts doing their jobs no matter what happens.

If you have any idea about how to suppress the effect of the RequiredFiledValidator when we need to cancel the process, please help.

Thanks a lot,

Question by:somits
    1 Comment
    LVL 8

    Accepted Solution


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on could not pull conte…
    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now