|
|
ASP.NET C#
Started by lolena1888 at 09-11-2006 11:42 AM. Topic has 1 replies.
 
 
|
|
Sort Posts:
|
|
|
|
09-11-2006, 11:42 AM
|
lolena1888
Joined on 09-12-2006
Posts 1
|
inherited class is not found
|
|
|
|
|
hi!
can somebody help me?
I use asp.net 1.1 (that's requirements) to create new website. I stuck with the following code.
I created template such as: using System; using System.Web; using System.Web.UI;
namespace Moft { public class BasePage2 : System.Web.UI.Page { private string pageTitle; ...}
// Base Control Class to Enable Access to Page Properties. public class page_template : System.Web.UI.UserControl { public new BasePage2 Page { get { return (BasePage2)base.Page; } } } }
I try to create pages using template: default.aspx:
<%@ Page language="C#" Src="Default.aspx.cs" AutoEventWireup="false" Inherits="MainPage" %> <table valign="middle" height="100%" width="100%"> ...
Default.aspx.cs:
using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls;
namespace Moft { public class MainPage : BasePage2 { protected Label labelYear; ...
when I run it on localhost, it tells me
Compiler Error Message: CS0246: The type or namespace name 'BasePage2' could not be found (are you missing a using directive or an assembly reference?)
I try not to use dll while working on project. Can somebody tell me why it cannnot find the class that is in the same namespace?
|
|
|
|
|
Report
|
|
|
|
08-30-2007, 9:28 AM
|
ewaltd
Joined on 08-31-2007
Posts 1
|
Re: inherited class is not found
|
|
|
|
|
Are the two classes in seperate projects? If so you need to set a reference to the project that holds the base class in the project you are trying to use it in.
If the classes are in the same project I might be able to help more with more info on the code.
Dan
|
|
|
|
|
Report
|
|
|
|
|
Webhost4life Fo... » General Discuss... » ASP.NET C# » Re: inherited class is not found
|
|
|
|