ASP.Net uses two ways/techniques of coding pages
1) Inline code
2) Code behind
1) In Inline code code is directly embedded directly within asp.net aspx page.
2) In code behind technique we have a seprate class that contains our logic for the asp.net aspx page. There by providing a clean separtion of presentation and logic. For code behind technique we have two ways to do it
a) Either use codefile attribute of page property in aspx page to do the logic of code it should specify the path of code behind file.This attribute is used together with Inherits attribute to associate a code behind source file with web page.This attribute is valid only for compiled pages
b) Either we use Inherits attribute where we can specify the class which has been derived from Page class.This is used with codefile attribute which contains the path to the source file for code behind class.