Src i.e. source code which is a general terminology is the ordered architecture of the page.The manner the page is construted and the modules implemented to arrive at the final look of the page.
On the other hand, The code-Behind is a complete isolated BLL i.e. Business Logic layer wherein the developer implements the logic to arruve to the desired outcome.
The client has access to the Source of the page but not to the Code-behind of the page,which obviously is not desired
example:
Src might contain the HTML tags in the form of say textboxes,button etc.,
Code behind might contain the logic how to add two numbers.
I hope that might clear your doubts.
src is placed in a separate file and is cached.Codebehind, javascript is contained in page and is more managable to control
Use src for big chucks of javascript u may want to share with other web pages and if you have performance concern, or you can use code-behind if you have a some small amount of javascript exclusive to your page.
SRC specifies the source file name of the code-behind class to dynamically compile when the page is requestedlogic for your page either in a code-behind class or in a code declaration block in the .aspx file
The Code-behind file gets compiled into a DLL assembly either at compile-time by VS.NET via the Codebehind attribute (default) or on-the-fly by the ASP.NET Runtime via the Src attribute. This Codebehind assembly is then combined with the .aspx file to create a second assembly (called a Page class) that actually serves up requests to the web page. The advantage of using the Codebehind attribute is that you forgo the first compilation of the Codebehind assembly. But when you use the Src attribute the codebehind file must be compiled on the fly.
src attribute represents the source file name in the code behind class that is dynamically compiled when the page is requested, VS.NET doesnt use this attribute because it precompiles the code behind page.
***************************************************************************** Please mark it Accepted if u find it helpful.
Raunak JhawarPosted Dec 29, 2009, 7:14 AM
On the other hand, The code-Behind is a complete isolated BLL i.e. Business Logic layer wherein the developer implements the logic to arruve to the desired outcome.
The client has access to the Source of the page but not to the Code-behind of the page,which obviously is not desired
example:
Src might contain the HTML tags in the form of say textboxes,button etc.,
Code behind might contain the logic how to add two numbers.
I hope that might clear your doubts.
Rekha SinghPosted Dec 29, 2009, 7:05 AM
compile when the page is requestedlogic for your page either in a code-behind class or in a code declaration
block in the .aspx file
The advantage of using the Codebehind attribute is that you forgo the first compilation of the Codebehind assembly. But when you use the Src attribute the codebehind file must be compiled on the fly.
*****************************************************************************
Please mark it Accepted if u find it helpful.
Hiren SoniPosted Dec 23, 2009, 7:29 PM
code behind specifies the name of compiled file that contains the class associated with the page