ASP.NET Page inheritence

G

Guest

On a web site that I am working on I have created a base page called
public abstract class WebsiteBasePage : System.Web.UI.Page
{
.....
}

The reason for this is to put standard code in it, for example retrieving
application settings from web.config, but each time I try to open a decendant
page

public class Default : WebsiteBasePage
{
....
}

I get the following error when I open the page up to design the HTML side of
things:

---------------------------
Microsoft Development Environment
---------------------------
The file could not be loaded into the Web Forms designer. Please correct the
following error and then try loading it again:

Type Abstract

Make sure all of the classes used in the page are built or referenced in the
project. Click Help for more information.
---------------------------
OK Help
---------------------------

The base class WebsiteBasePage is in the same namespace as default.aspx.
This is the page inheritence tag in the aspx file.
<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false"
Inherits="StandardSnowdropORS.Default" %>

TIA
Graham Harris
 
S

Scott Allen

This is a limitation in VS 2003, WebsiteBasePage must have the
"abstract" keyword applied on the class or on a method. If you want to
use the designer you'll have to make the class concrete, i.e.
non-abstract, i.e. provide a default implementation for all of the
class members.
 
G

Guest

Thanks that worked..

Graham Harris

Scott Allen said:
This is a limitation in VS 2003, WebsiteBasePage must have the
"abstract" keyword applied on the class or on a method. If you want to
use the designer you'll have to make the class concrete, i.e.
non-abstract, i.e. provide a default implementation for all of the
class members.
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top