You may have noticed that Visual Studio.NET adds an interesting keyword to the Page directive of an ASP.NET web form: CodeBehind. However, you will not find this documented in the .NET documentation for the Page directive. Visual Studio.NET implements CodeBehind by precompiling the base class, then uses the Inherits keyword to refer to that class. The CodeBehind keyword allows the IDE to remember the file containing your base class. However, what if you do not want to precompile your class into an assembly?
According to the .NET documentation, the Src attribute of the Page directive:
Specifies the source file name of the code-behind class to dynamically compile when the page is requested. Note: RAD designers, such as Visual Studio.NET, do not use this attribute. Instead, they precompile code-behind classes and then use the Inherits attribute.
So, by using the Src attribute to indicate the file, and the Inherits keyword to indicate the class, you can accomplish Codebehind. Here is an example Web Form Inheriting from the HelloWorld class in the HelloWorld.cs file: