I am finding that my UI code is looking rather messy, because I am having to add .Net formatting code, to my View code. An example:
<tr data-url="@Url.Action("EditTransaction", "Transaction", new {[email protected]})" class="clickableRow @(line.IsDeposit ? "credit_colour" : "") ">
So, the row needs to use the 'credit_colour' class if line.IsDeposit - else, the default TR class.
I have more of those, some more complex.
The main issue, in the above code, is the:
@(line.IsDeposit ? "credit_colour" : "")
Is it acceptable/good practise, to be using such formatting conditions within my view code, or should this sort of logic be performed within the Controller method, and somehow passed to the View?