Last post Mar 26, 2012 09:16 PM by Ict-Guy
Mar 25, 2012 09:07 AM|chenna008|LINK
how to show alertbox in Razor mvc3. for validations
Mar 25, 2012 09:17 PM|kshyju|LINK
asp.net mvc3 comes with jquery validate pluggin. You can customize that to show the error message in an alert instead of showing it in a page.
But think twice, do we need do this ? What if we have validations for 5 fields and user did not fill that tried to submit the form. Its gonna show 5 alerts to the user and that is not a good user experience. You can even customize the script to show the
first alert and return false there. But showing all error messages at once make the life of user easy. Thats y the validation summary messages there . How will you handle this if you use alert box ?
Mar 26, 2012 01:01 PM|nirman.doshi|LINK
Agree with the above point... ValidationSummary is ideal for showing errors. rather than showing them in alert boxes.
But, yes there are certain situations where alert box can also be handy. (A scenario when a user forgets to accept License terms)
To show alert box in MVC, you should use JQuery which is by default included as you create a new MVC application.
simply, call "alert" in your client-side method in JQuery
Mar 26, 2012 08:47 PM|thaicarrot|LINK
var dialog = confirm('PHP is best.');
Mar 26, 2012 09:16 PM|Ict-Guy|LINK
Have a look at this blog