Solved

Validation errors in asp.net MVC application are preventing the user to exit form/view.

Posted on 2014-11-29
2
149 Views
Last Modified: 2014-12-06
Validation errors in asp.net MVC application are preventing the user to exit form/view.

How to avoid that so that user can exit the form/view without being forced to enter values? Or How to implement cancel/exit button without forcing the user to enter values in html controls?
0
Comment
Question by:Jugnoo2013
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 total points
ID: 40472495
What you're saying doesn't really make sense. The user could click a link on the page to take them elsewhere or type a new address into the URL. The validation will prevent them from submitting the page but it wouldn't prevent them from leaving the page (i.e. going to another URL).

If you want a Cancel button just put another button on the form with a type of "button" and an onclick that sends the user to another URL.

<button type="button" onclick="window.location.href = 'yourpage.html'">Cancel</button> 

Open in new window

0
 

Author Comment

by:Jugnoo2013
ID: 40472818
You are correct; it is prevent post. Thanks a bunch; I will give it a try and accept your solution if it works fine in ASP.net MVC app.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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