Solved

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

Posted on 2014-11-29
2
147 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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

821 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