Ray's Asp.net Blog
Answers and code snippets from ASP.NET projects (Webforms/MVC/Classic ASP)
Pages
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment