Welcome to Webhost4life Forum Sign in | Join | Faq

ASP.NET C#

Started by lolena1888 at 09-11-2006 11:42 AM. Topic has 1 replies.

Print Search
Sort Posts:    
   09-11-2006, 11:42 AM
lolena1888 is not online. Last active: 9/12/2006 2:40:55 AM lolena1888

Top 500 Posts
Joined on 09-12-2006
Posts 1
inherited class is not found
Reply Quote
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 is not online. Last active: 8/31/2007 12:26:19 AM ewaltd

Not Ranked
Joined on 08-31-2007
Posts 1
Re: inherited class is not found
Reply Quote
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# » inherited class is not found

Powered by Community Server, by Telligent Systems