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
▼
Tuesday, April 2, 2013
How to set Max length for an input in ASP.NET MVC
By StringLength data annotation
[StringLength(20, ErrorMessage = "Name cannot be longer than 20 characters.")]
public string Name { get; set; }
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment