asp.net Core modelstate validation is always False

Source: Internet
Author: User
asp.net Core modelstate validation is always false Environment

Win7 x64, Visual Studio 2017, Net Core 2.0 page Tips

The value ' is invalid
Describe

When a page submits a form, modelstatus.isvalid always resolves or causes the problem

The cause of this problem is that the parameters on the page and the type of the received parameter in the method are inconsistent
idea:
The parameters that the debug method receives do not see anything wrong
Since the receive parameter is no problem that must be the reason for the page assignment, by examining the assignment of the page to the parameter, the default value for the parameter is found to be null (""), and the type that receives the parameter in the method is the GUID, attempting to assign an empty GUID value to the parameter, and discovering that the current problem is not present.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.