I have a TextArea() control in my View implemented using Razor Engine.
@Html.TextArea("EventNature",new { style = "width: 200px; height: 100px;" })
How can i set the Maxlength attribute for this control?
is there any built in Attribute in RazorEngine or do i have to use scripts?
You can do it like:
Just be aware it’s an HTML5 attribute
MDN
Javascript(using jQuery) validation for HTML <5:
DEMO