How to keep the Razor files free of code logic?
Posted on 2011-10-20
I am trying to understand how to apply best practices coding to my Razor files. I understand that I should keep the Razor files free of code logic, when possible. But often calling C# properties is important to setting the CSS. So do these make sense to accomplish this?
- Move the HTML definition to the Model, or a Helper class.
- Make Model return a property that's the CSS class?
If not, how best can I accomplish the goal of keeping the Razor files free of code logic?