Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6102443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:36:53+00:00 2026-05-23T13:36:53+00:00

I have form with few text boxes which goes through validation (both server and

  • 0

I have form with few text boxes which goes through validation (both server and client sides). In the form I have buttons: “Next”, “Back”, “CanceL”. So I don’t need validation to fireup then user clicks “back” or “cancel” buttons. How can I achieve this?
Thanks in advance!


Some sample:

<div class="buttons">    
<input type="submit" name="cancelButton" value="" />
<input type="submit" name="backButton" value="" />
<input type="submit" name="nextButton" value="" />
</div>

<% using (Html.BeginForm()) { %>
    <p>

    <table style="width: 200px">    
    <tr><td align="center" colspan=2><%= Html.ValidationMessageFor(m => m.street) %><%= Html.DropDownListFor(m => m.street, Model.streetsList) %></td></tr>
    <tr><td colspan=2>&nbsp;</td></tr>
    <tr><td valign="bottom" align="right" style="width: 75px"><%= Html.LabelFor(m => m.flatNumber) %>:</td><td align=left><%= Html.TextBoxFor(m => m.flatNumber, new { maxlength = 6, style = "width: 48px;" })%> <%= Html.ValidationMessageFor(m => m.flatNumber) %></td></tr>
    </table>
    <br />

        <input type="submit" class="refusal button red floatL" name="cancelButton" value="" />
        <input type="submit" class="back button green floatL" name="backButton" value="" />
        <input type="submit" class="continue button green floatR marR" name="nextButton" value="" />
    </div>
    <div class="clear">
    </div>
    <% } %>

At the server side I use DataAnnotations attributes for validation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:36:53+00:00Added an answer on May 23, 2026 at 1:36 pm

    the Button class has a CausesValidation property – if that is set to false, validation won’t be triggered on postback.

    Example:

    <asp:Button id="btnCancel" CausesValidation="false" onClick="bntCancel_Click" Text="Cancel" runat="server" />
    

    Note that this will disable the ASP.NET validators – if you have your own validation you will need to disable it another way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form which has a few text boxes, and two submit buttons.
I have a few text boxes and buttons on my form. Lets say txtBox1
I have a form with a list box and a few text boxes, when
I have a form with a few text-boxes and a Grid-view. There is this
I have problem with TinyMCE editor. I have form with few text fields and
So i have a simple form that takes a few inputs (two text and
I have form with few buttons and I want to know what button is
i have form in drupal which uploads images and has got few checkboxes in
I have a form, the first .class has 5 input:text boxes in it. I
i have database table with few text fields which i use to filter data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.