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

前端 未结 5 847
一生所求
一生所求 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 03:51

    Here's another way to think about it. Presentation logic goes in the view. Business processing logic goes in the controller, and data validation goes in the model. But what goes where should ultimately be guidance and not religion:)

提交回复
热议问题