What is the difference detween SRC and CODEBEHIND Tags?

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

Hello,

What is the difference between SRC and CODEBEHIND Tags?

Example

<%@ Page Language="vb" ValidateRequest="false" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" %>

or

<%@ Page Language="vb" Src="WebForm1.aspx.vb" Inherits="WebForm1" %>

Thanks,

Jack
 
From MSDN Library @Page Directive page:

SRC specifies the source file name of the code-behind class to dynamically
compile when the page is requested. You can choose to include programming
logic for your page either in a code-behind class or in a code declaration
block in the .aspx file

CODEBEHIND specifies the name of the compiled file that contains the class
associated with the page. This attribute is used by the Visual Studio .NET
Web Forms designer. It tells the designer where to find the page class so
that the designer can create an instance of it for you to work with at
design time. For example, if you create a Web Forms page in Visual Studio
called WebForm1, the designer will assign the Codebehind attribute the value
of WebForm1.aspx.vb, for Visual Basic, or WebForm1.aspx.cs, for C#. This
attribute is not used at run time.

DalePres
MCAD, MCDBA, MCSE
 
No.

Everything gets compiled to an assembly after the first
page call, so there's no difference between a compiled
page, a codebehind-compiled page, or an assembly.

*Everything* runs from ram after the first call.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
=====================
 
FWIW, me not having Visual Studio.NET I have become very familiar with
src=...

In a nutshell, the only difference I can perceive between them is that
codebehind is only used in the VS.NET development environment. If
you're coding using notepad, you use src.
 
Thank you this is the short correct answer

also please note visual studio products and SDK products are not compatible
 
Back
Top