Wrox Programmer Forums
|
BOOK: Professional ASP.NET MVC 5
This is the forum to discuss the Wrox book Professional ASP.NET MVC 5 by Jon Galloway, Brad Wilson, K. Scott Allen, David Matson; ISBN: 978-1-118-79475-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2016, 10:45 AM
Registered User
 
Join Date: Apr 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5 How to customize error

in chapter 5 it is explained how to set particular error for a specific field when it is invalidated.it uses ModelState.AddModelError in the controller. but something is wrong with this an that is such error is displayed always even before submitting the formso if one want to create a specific error for a specific field what he must do?

furthermore I couldn't find where the error text for a field has been set?
THANK YOU!

Last edited by koosha_pooyeshgar; April 26th, 2016 at 10:49 AM..
 
Old April 29th, 2016, 12:27 PM
Authorized User
 
Join Date: Jan 2013
Posts: 23
Thanks: 1
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by koosha_pooyeshgar View Post
in chapter 5 it is explained how to set particular error for a specific field when it is invalidated.it uses ModelState.AddModelError in the controller. but something is wrong with this an that is such error is displayed always even before submitting the formso if one want to create a specific error for a specific field what he must do?

furthermore I couldn't find where the error text for a field has been set?
THANK YOU!
What page, and where on that page?
 
Old May 2nd, 2016, 11:56 AM
Registered User
 
Join Date: Apr 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Tomyris View Post
What page, and where on that page?
in the page 123.
 
Old May 3rd, 2016, 01:30 PM
Authorized User
 
Join Date: Jan 2013
Posts: 23
Thanks: 1
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by koosha_pooyeshgar View Post
in the page 123.
I looked at it and I didn't see a problem - I would have to go back and follow writing the code to see what you are asking. Sorry! I may do that after I finish the book. That is probably too late for you.

I guess I am the wrong person to help you. Did you look at the downloaded code? Does that help? Maybe see if someone has encountered this on Stack Overflow or some other place if this doesn't help. Sometimes the MSDN tutorials and Question and Answer can help.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Customize ThemeSelector rpcasey001 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 March 7th, 2009 01:08 AM
Customize Datagrid Mohamed_sherief ASP.NET 2.0 Professional 5 August 23rd, 2007 09:31 PM
customize button angelboy C# 2005 0 June 24th, 2007 10:01 AM
customize Paula222 ASP.NET 2.0 Professional 0 November 9th, 2006 12:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.