Reputation: 2055
Is it possible to get a red build whenever the html in a razor template is invalid? I thought it already worked that way... But I guess not.
<div>
@Html.DisplayTextFor(model => model.FooterText) // this will be a build error
</div>
<div class="banana> // this isn't a build error but i want it to be
</div>
Upvotes: 0
Views: 117
Reputation: 4393
The default for visual studio is to report html validation errors as warnings. You can tell it to report them as errors under Tools -> Options then under Text Editor -> HTML -> Validation and uncheck "as warnings".
Upvotes: 1
Reputation: 5989
Surely the above wrong html will give you warning in VS. you can ask VS to make those as error.
Happy coding
Upvotes: 2