Contact form. Message limit
I have form on my website which is contact form. I am using ReCaptcha on that. The 开发者_StackOverflowform just sending email, no records to data base.
So my question is should i put character limit on that message?
It's always a good idea to put limits on input fields. For example you could decorate the property on your view model which is bound to the message with the StringLength
attribute to enforce validation.
[StringLength(1000, ErrorMessage = "The message must be at most {1} characters long.")]
[AllowHtml]
public string Message { get; set; }
精彩评论