Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Telerik overriding htmlattributes?

$
0
0

I have an existing .NET MVC app where I upgraded it to a Telerik MVC app, and I'm noticing my controls htmlattributes are being overridden it seems.

In my view I have controls like this:

@Html.EditorFor(model => model.CompanyName, new {htmlAttributes = new {@class = "form-control", required = "true"}})

which would previously render like:

<input name="CompanyName" class="form-control text-box single-line" id="CompanyName" required="true" type="text" value="" data-val="true" data-val-length-max="50" data-val-length="50 characters max">

Now with Telerik, they render like this:

<input name="CompanyName" class="k-textbox" id="CompanyName" data-val="true" data-val-length-max="50" data-val-length="50 characters max">

You can see I'm losing my form-control, etc classes, and the required attribute. What is overriding this and how should I handle this?


Viewing all articles
Browse latest Browse all 78072

Trending Articles