It should be noted that "Code Behind" is a feature of the Web Forms viewer. This really has nothing to do with ASP.NET MVC itself.
For example, the Razor viewer in MVC3 does not even support it.
I would answer your question as follows: if you cannot switch view mechanisms without overwriting your controllers (or even your models), you are not using the MVC pattern correctly.
Probably most of what you do in the .aspx.cs file really needs to be done before the model (or View Model) is passed to the view. However, in the projects that I migrated from ASP.NET Web Forms to ASP.NET MVC, I left a lot of code behind. For example, I find it cleaner and more enjoyable to use the Repeater element than trying to use the "for" loop in Web Forms. I am still just repeating Model Model data. So why not? The separation of problems persists (perhaps more so in reality).
I mean, why is the “best practice” for Web Forms suddenly becoming the wrong way to view web forms? As a simple example, consider Repeater, which assigns a different CSS class to every second row of the table. Why should my controller (or even my model) care? Trying to put that logic into a web form quickly turns into a soup soup and full of spaghetti. Now imagine something more complex.
I left the master pages in place, which build the menus in code. Again, all the data comes from the view model. I do not understand why using a GridView or other controls in this case should also be a problem.
I usually turned off ViewState in Web Forms and bound the data in "Init". However, often there was a small ViewState, which I could not get rid of. I put some code in the "Render", which moves it around the form (by default it is by default). When switching to MVC, I sometimes left this code. So, I have ASP.MVC sites that really use Code Behind. I just try to make this code specific to the presentation.
In new projects, as a rule, I found that most pages do not require Code Behind. Fortunately, viewing engines like Razor made code mixing and markup on the network much less painful to write, read, and maintain.