开发者

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; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜