This has been posted in other non-MSDN forums (as far as I am aware) so I will add it here in the hope of getting some answers.
I have been evaluating SharePoint Portal 2007 and in particular its support for ASP.NET pages.
What I found is that while adding custom C# code to an aspx file to handle an event such as a button click within the <script runat="server"> tag is okay, you cannot abstract this out to a Code Behind file.
I tried using the "CodeFile" attribute and was presented with the "The codefile attribute on the page directive is not allowed in this page" error.
This seems to me to be an odd emission, reading the marketing material I was convinced that it had full support for ASP.NET. Evidently this is not quite the case (depending on how you read it I guess)
Is there a way around this and if not is one planned?
If you are only wanting to keep the code separate and not wanting to be able to edit the code behind file on the server, ie. in Notepad, you can use the Inherits attribute and point to a .Net Assembly: