Ray's Asp.net Blog
Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)
Pages
(Move to ...)
Event registration app with QR/Paypal
Home
▼
Friday, January 6, 2012
How to make one field is optional (not required) in ASP.NET MVC data annotations for validation?
Make that field is nullable in model. Such as:
[
Display
(Name =
"ID"
)]
public
int
?
ID {
get
;
set
; }
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment