Solved

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

Posted on 2014-11-29
2
148 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

Suggested Solutions

Title # Comments Views Activity
Clean Uninstall of VS Professional 2015 5 63
Messagebox for a Web Site Application 4 86
Explain Unit of Work pattern 2 86
What namespace do I need to import? 2 52
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

732 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