Are Codebehind Files in ASP.NET MVC Evil?

Interesting discussion about the benefits of codebehind files in ASP.NET MVC.

While keeping the codebehind files might tempt you to put code that belongs to the controller on to the view, I’m not worried about that. In the ASP.NET work I’ve done in the past, I’ve mostly stuck to pushing any logic other than formatting out into a separate class that communicates with the business layer – a controller class, effectively. I’ve seen a lot of code where the codebehind was chock-full of business logic, so I suppose the same mistake could be made moving to ASP.NET MVC.

Advertisements