In my last post about CodeBehind, I stated that the CodeBehind attribute for the @Page directive was gone. It was, and VS 2005 Beta 1 threw an error when i tried to put it there. Mysteriously, now, it is back. It appears in the intellisense window and everything. I can use the code-behind attribute, but it literally does nothing now. It doesn’t make the “View Code” menu item work. It’s functionality is gone. If you want to implement a code-behind file as a base class, you can do that by making that type the Inherits”. . “ attribute, but it really won’t be a code-behind file because it wont work if you keep it next to the ascx file. You would have to put it in the Code directory for it to even compile. Then your user control would see it and be able to inherit its functionality, so you can still do the inheritence that code-behind gave you, but code seperation is done with the code-beside partial class.
To be honest, at first I was a bit bitter that Microsoft had taken away my code-behind, but now I do see the benefit of code-beside. I still think that code-behind should be an option. I don’t the the removal of features is the answer. I, as a developer, like options. I also want explicit compiling put back so that I can actually have a web-specific assembly. And I’d like to be able to designate more directories for dynamic compilation (not just /Code).