How add a class to @Html.EditorFor?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 years ago
Good afternoon.

I want to add a class to @Html.EditorFor (model => model.FirstName, new {@class = 'form-control'}), but the text-box single-line class is generated. How should I be in this situation?

Thanks
3 years ago
Hi,
you should not use Apostrophe to declare string. Use Quotation mark instead.
 @Html.EditorFor(model => model.Name, new { @calss = "form-control" })
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.