Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET Page inheritence

Reply
Thread Tools

ASP.NET Page inheritence

 
 
=?Utf-8?B?Ym1zZ2hhcnI=?=
Guest
Posts: n/a
 
      08-21-2005
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
 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      08-21-2005
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 21 Aug 2005 00:34:01 -0700, "bmsgharr"
<> wrote:

>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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Ym1zZ2hhcnI=?=
Guest
Posts: n/a
 
      08-21-2005
Thanks that worked..

Graham Harris

"Scott Allen" wrote:

> 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.
>
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
>
> On Sun, 21 Aug 2005 00:34:01 -0700, "bmsgharr"
> <> wrote:
>
> >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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Visual Studio + Dreamweaver, Page Inheritence + Templates Mark ASP .Net 1 03-28-2005 01:39 PM
vs designer and code-behind inheritence Eric Biggs ASP .Net 0 04-14-2004 04:25 PM
Inheritence question Doug Nichols Perl 0 02-19-2004 01:08 PM
Web User Control Inheritence -- how to do? jqpdev ASP .Net 2 02-15-2004 11:15 PM
UserControl Inheritence Design Time Editing Kenton Smeltzer ASP .Net 0 01-29-2004 03:41 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57