Base Page inheritance in ASP.NET 2.0

C

Craig Street

Hi

How do i create a base page in ASP.NET 2.0? I don't want to use master pages
as I don't need any visual inheritance.

You could do this simply in ASP.NET 1.1 by creating a base page that
inherted form System.Web.UI.Page and then ensuring that all of your pages
inherited from your own base page.

With the advent of partial classes this seems somewhat more difficult.

I've got the following code


public partial class Default_aspx : BasePage

{

}



where BasePage is a custom base page that I have created, but I get the
following error when i try and compile

CS0263: Partial declarations of 'Default_aspx' must not specify differenet
base classes



Thanks
 
P

Patrice

(Not checked).

It looks like to me that :
- the aspx page inherits from the base class
- the code uses then the partial keywork to "complement" the whole derived
class

I would look if the class from which a page inherits is not now a directive
in the ASPX page.

Please let us know.

Patrice
 

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

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top