How much logic is allowed in ASP.NET MVC views?

前端 未结 5 837
一生所求
一生所求 2020-12-15 03:49

In looking at samples of ASP.NET MVC sites, I\'m seeing quite a bit of examples with embedded logic in the views, e.g.:

<% if (customerIsAllowed)
   { %&g         


        
5条回答
  •  萌比男神i
    2020-12-15 04:07

    42.

    Just kidding :-)

    There's no set answer to this, though a good separation of concerns is a generally accepted best practice. The debate around this can be pretty endless, and knowing the right way to do it for your particular project comes with experience I think and being able to notice "code smell" or things that don't feel right.

提交回复
热议问题