Skip to content

adding additional attributes to "EditorFor" control #78

Closed
@mossywossy

Description

@mossywossy

Hi,
I am migrating an old MVC razor project to use Bootstrap and have been finding this solution to the task great.
However, I have been trying to add additional attributes to an input control for a DateTime property type. I would typically do this as follows:

@html.EditorFor(model => model.DateTimeFrom, new { Attribute1 = "valueOfAttribute1"})

This is not working. The attribute isn't rendered at all in the resulting page. I believe this is down to this Bootstrap for MVC solution. Is it? Or am I using it incorrectly?

Kind regards.

Tomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions