开发者

Contact form. Message limit

开发者 https://www.devze.com 2023-04-05 10:55 出处:网络
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.

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

精彩评论

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