newbie question - codebehind error

M

Mori

Using VS.NET 2003, I'm trying to run an aspx file with this code:

<!-- GuidedPracticeExercise1_3.aspx -->
<%@ Page Language="C#"
CodeBehind="GuidedPracticeExercise1_3.aspx.cs"
AutoEventWireup="false"
Inherits="_315C01.GuidedPracticeExercise1_3"%>
<html>
<body>
</body>
</html>


Now I take it that "GuidedPracticeExercise1_3.aspx.cs" is the codebehind
file. I have put some code in the Page_Load() method to display something in
the "GuidedPracticeExercise1_3.aspx" page. I have compiled the code behind
file with this:
csc /t:library /out:bin\GuidedPracticeExercise1_3.dll
GuidedPracticeExercise1_3.aspx.cs

But running the page (without debugging) I get this error:

Parser Error Message: Could not load type
'_315C01.GuidedPracticeExercise1_3'.

Source Error:


Line 1: <!-- GuidedPracticeExercise1_3.aspx -->
Line 2: <%@ Page Language="C#"
Line 3: CodeBehind="GuidedPracticeExercise1_3.aspx.cs"AutoEventWireup="false"Line 4: Inherits="_315C01.GuidedPracticeExercise1_3"%>


Source File: c:\inetpub\wwwroot\315C01\GuidedPracticeExercise1_3.aspx
Line: 2


Can somebody pint me in the right direction please,
Thanks
Mori
 
D

Daniel Fisher\(lennybacon\)

The cb looks like this?

namespace _315C01
{
public class GuidedPracticeExercise1_3
{

}
}
 
M

Mori

Yes the cb does look like that. I think I fixed it though. I added this:

Src="StepByStep1_9.aspx.cs"

Now I'm a bit confused. I read that you don't need this line when
pre-compiling the cb file. Can you clear this confusion up for me? Is
Src="****" always needed for cb files?

thanks
Mori
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top