Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...(I) have been able to get my problems solved from past messages and also new posts that other users have responded to promptly..."

Geography

Where in the world do Tek-Tips members come from?

CodeFile attribute is not supported by page directive

emozley (TechnicalUser)
15 Jun 12 8:04
Hi,

I am trying to teach myself C#.NET and am trying to create a blank page that uses a master page template.

My default.aspx page is as follows:

CODE

<%@ Page Title="" Language="C#" MasterPageFile="~/dotnet/masterpages/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>

However I am getting an error message:

Parser Error Message: The 'CodeFile' attribute is not supported by the 'page' directive.

Source Error:


Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/dotnet/masterpages/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" %>
Line 2:
Line 3: <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


Source File: D:\Clients\dotnet\default.aspx Line: 1


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2494; ASP.NET Version:1.1.4322.2494



Any ideas where I am going wrong?

Thanks very much

Ed
jbenson001 (Programmer)
15 Jun 12 10:55
What framework are you using? It' can't possibly be version 1.1.
What version of visual studio are you using?
emozley (TechnicalUser)
15 Jun 12 11:56
Hi there,

I am using Visual Studio 2010. I don't know how to check what framework I am using but my IIS server where the code is hosted is runing Windows Server 2003 R2. If I go into add/remove programs of the IIS server I can see there is Microsoft .NET Framework 3.5 SP1 (and hotfixes) as well as earlier versions of .NET framework. Is this what you mean?

Thanks very much

Ed
emozley (TechnicalUser)
15 Jun 12 12:00
A bit more background info which might help you troubleshoot. The way I started was to create a new folder in an existing ASP classic website and then added my pages and folders in there.

On the IIS server if I right click the folder that has my .NET code in and view the properties and click ASP.NET tab it says it is using ASP.NET version 1.1.4322 but this is on a drop down menu that is greyed out.

Thanks

Ed
MarkSweetland (MIS)
15 Jun 12 12:00
This may help:
http://msdn.microsoft.com/en-us/library/ms227671.a...


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach

jbenson001 (Programmer)
15 Jun 12 13:36
I would just start a whole new website or web project. Don't try to incorporate .net pages with classic asp pages.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close