p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

aspx thread: Problem In Inheriting a Codebehind Class

Message #1 by "Subraya Hegde" <subrayah@i...> on Thu, 4 Jul 2002 09:53:39 +0530
Hi all,

   I just installed ASP.NET SDK in my new Win2K(Pro) machine, (Microsoft
.NET Framework
Version:1.0.3705.0; ASP.NET Version:1.0.3705.0) which is available as a
redistributable EXE
in the ASP.NET site. I do not have Visual Studio.NET installed in my

  Now my problem is I am not able to use a codebehind class file associated
with an ASPX file.
For example, if I have an ASPX file by name Test.aspx and the code behind
file for this as Test.aspx.cs,
and If I write the @Page directive like this,

<%@ Page Language="C#" Codebehind="Test.aspx.cs" Inherits="Test" %>

I get the error "Could not load type 'Test'."
Can anyone help me in getting a solution for this ?
Thanx in advance,

Message #2 by "Subraya Hegde" <subrayah@i...> on Fri, 5 Jul 2002 09:01:42 +0530
Hi there,

  Sorry for this posting once again. Fortunately, I got a solution for the
above issue.
We have to create a dll (library) for the Test.aspx.cs file and keep the
file in the bin directory. Then we will not face any problem in Inheriting a
class file from the Aspx file.

For example, use the tool like this.
    csc /t:library /out:bin/Test.aspx.dll Test.aspx.cs


  Return to Index