Monday, March 17, 2008

CodeFile vs Codebehind?

I have just migrated one vs2005 web site project to vs2005 web application project and noticed that instead of CodeFile attribute, tha Page/Control directive uses Codebehind and searched to find something more about these two.

CodeBehind
Specifies the name of the compiled file that contains the class associated with the control. This attribute is not used at run time.
Note:
This attribute is included for compatibility with previous versions of ASP.NET, to implement the code-behind feature. In ASP.NET version 2.0, you should instead use the CodeFile attribute to specify the name of the source file, along with the Inherits attribute to specify the fully qualified name of the class.

CodeFile
Specifies a path to the referenced code-behind file for the control. This attribute is used together with the Inherits attribute to associate a code-behind source file with a user control. The attribute is valid only for compiled controls.

No comments:

eXTReMe Tracker