문제

Can I exclude the valudation rule for the ID property? Right now I get the following validationerror message when I submit the form:

  • The Id field is required.
도움이 되었습니까?

해결책

From http://xval.codeplex.com/Thread/View.aspx?ThreadId=54212

getting a ModelState.IsValid = false with a message of “ID is Required”

I think you're talking about server-side validation here. Remember that xVal's key job is enabling client-side validation, where this problem doesn't occur. On the client, you won't create a textbox for "ID" (because you wouldn't want the user to edit it directly) - at least not during the creation phase - so the client-side validator would ignore the ID property, not attempting to validate it because there's no input control to validate. On the server, the behaviour will vary according to which validation runner you're using.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top