I am using Server Side Validation On ASP.NET MVC Kendo UI. On a view(used to create) for a text field like this:
@Html.Kendo().TextBoxFor(model => model.CompanyTypeName).Name("CompanyTypeName")
I need to change the size of textbox. I tried like this:
@Html.Kendo().TextBoxFor(model => model.CompanyTypeName, new { style = "width:50px", @maxlength = "5" }).Name("CompanyTypeName")
But doesn't work.Thanks in Advance.
This is only valid using a default textbox.
@Html.TextBoxFor(model => model.CompanyTypeName, new { style = "width:50px", @maxlength = "5" })
This is what you can do:
@Html.Kendo().TextBoxFor(model => model.CompanyTypeName).HtmlAttributes(new { style = "width:50px", @maxlength = "5" }).Name("CompanyTypeName")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With