I've noticed in that a lot of the fields I'm putting into my views are control logic:
@if (Model.IsAdmin) {
<p>You're an admin</p>
}
My understanding of how MVC should be working is that what goes into the model should act much more like a data, it's returned if it's a form, it's for the user to see/change, etc.
Is putting control logic in a view bad practice? What is the convention for passing control logic to a view in MVC?
Is putting control logic in a view bad practice?
No, you could perfectly fine have view logic inside your views to conditionally show or hide some sections. Your particular example is perfectly fine in a view.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With