Solved

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

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now