we can write page logic in two models if we write page logic in .aspx file that is called code inlinemodel if we write page logic in a separate file that is known as code behind model
Code behind technich is the new feature of Asp.net 2.0 which provides the separation of logic code with that of designing code .
As in t he previous version of Asp.net all the programming logics as well as design code is being written in same file which make it more complex to edit and analys.
But in this code behind we have to separate file one is called ".aspx" file which take care of design part of the application as if we have to do any edition in design part we can do very easily.
And the secnd one is langauage specific file which may be of extension ".CS",".VB" as per of the language used by the program to write the programing Logics of the application.
Code behind is the separation of the presentation from the logic.
Presentation that includes server/HTML controls are included in the .aspx page
And the code behind file (.aspx.cs/.aspx.vb) contains the logic using the event driven model.
The code behind file derives from the Page class and at runtime the a class derieved from the code behind class is created and the .aspx controls are embedded in to it.