Page inheritance architecture in ASP.NET

B

BK

I am writing a tiered inheritance structure in ASP.NET and would like
opinions on the best way to accomplish the correct inheritance dynamically.
The page structure is going to look similar to the following:

System...Page
|
MyBasePage
|------------------|--------------------|
CategoryPageOne CategoryPageTwo CategoryPageThree
| | |
[Lots of Pages] [Lots of Pages] [Lots of Pages]


There is a custom control that needs to be included at the "CategoryPage"
level and then "visually" inherited by the other pages (not sure that this
is even possible). Is it? If so, do I do it using a .cs class file or a
..aspx page. Essentially, I'm just looking for some direction on what methods
or techniques that I might use to accomplish this.

For example, how do I have sections defined at the "CategoryPage" level
placed at the correct places without MyBasePage having to know details about
its derived pages' structure? MyBasePage may define headers and footers, but
then the CategoryPages may have completely different layouts between the
header and the footer. How do I generically tell MyBasePage to "build
whatever the CategoryPages tell you to build"?

Any help appreciated,
BK
 
J

Jay B. Harlow [MVP - Outlook]

BK,
ASP.NET only supports code inheritance (.cs file) not visual inheritance
(.aspx file).

You may want to ask this "down the hall" in the
microsoft.public.dotnet.framework.aspnet newsgroup, as there are a couple of
template methods that you can use...

Hope this helps
Jay
 

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

Top