Re: CodeFile - or a bug in VS?

Tech-Archive recommends: Fix windows errors by optimizing your registry



If you create a new Web Application, the page declaration looks like this :

<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="Default.aspx.vb" Inherits="WebApplication1._Default" %>

That's OK...and will compile without problems.

If you create a new Web Project, the page declaration looks like this :

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>

That will also compile without problems.

There's no bug...just different declarations for different
types of VS applications ( "web project" vs. "web application" ).





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
=========================
"Lubomir" <Lubomir@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CCAFEBBE-78A3-4632-95FA-1C46E118768D@xxxxxxxxxxxxxxxx
Hi,

I am using VS 2008. and a project target platform is .NET 3.5. When I create
a new web app project, the VS generates a default asp page, with the page
directive. There is an attribute Inherits as expected and an attribute
CodeBehind. This attribute should not be there,the CodeFile should be used
instead. I have to change it manualy, otherwise I get a runtime server error.

Is this a bug in VS 2008 or am I missing something? I have patched OS and VS.

Thank you for help,
Lubomir




.



Relevant Pages

  • Re: CodeFile - or a bug in VS?
    ... 1/ Page declaration has attribute CodeBehind and Inherit ... 4/ I change CodeBehind to CodeFile. ... The app was compiled but failed to compile and we didn't notice. ... do you have a namespace declaration like this one? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: CodeFile - or a bug in VS?
    ... 1/ Page declaration has attribute CodeBehind and Inherit ... 4/ I change CodeBehind to CodeFile. ... The app was compiled but failed to compile and we didn't notice. ... do you have a namespace declaration like this one? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: CodeFile - or a bug in VS?
    ... CodeFile should be generated isntead of the CodeBehind attribute. ... That's OK...and will compile without problems. ... If you create a new Web Project, the page declaration looks like this: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: CodeFile - or a bug in VS?
    ... This is not a bug that you are seeing. ... CodeFile means compile at runtime and your page will behave like a web site project instead of the web application project. ... do you have a namespace declaration like this one? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Defining variable in C header file related doubt
    ... And it didn't compile, obviously. ... with int g declared in both files (and apparently ... "An external def1nition is an external declaration that is also a ... If an identif1er declared with external linkage is used in an ...
    (comp.lang.c)