I always thought it was bad practice to put programming code inline with the markup file, instead of the code behind file.
That's true for C# WinForm/WPF developer that use MVVM architecture. But, I think it is still good practice to put programming code inline in ASP.NET MVC.