?
Solved

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

Posted on 2014-11-29
2
Medium Priority
?
151 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 2000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

801 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