473,396 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Page inheritance

I have created an aspx page called Page1. The class associated with the page
in code behind is abstract.
Now I want to create another aspx page call Page2 that inherits the Page1.

It seems like the Page2 inherits the code behind defined by Page1 but it
does not inherits the html content (the controls) of the Page1.
So, I do not have the controls on my new page.

Can somebody tell me where I am wrong?

Nov 17 '05 #1
4 1688
The HTML isn't part of the class. Why don't you simply create a user
control and Page.LoadControl it (or Register it), if I understand what you
are trying to do, this is how you should do it.
Karl

"Mircea Pleteriu" <mp*******@asp-gmbh.de> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
I have created an aspx page called Page1. The class associated with the page in code behind is abstract.
Now I want to create another aspx page call Page2 that inherits the Page1.

It seems like the Page2 inherits the code behind defined by Page1 but it
does not inherits the html content (the controls) of the Page1.
So, I do not have the controls on my new page.

Can somebody tell me where I am wrong?

Nov 17 '05 #2
The HTML isn't part of the class. Why don't you simply create a user
control and Page.LoadControl it (or Register it), if I understand what you
are trying to do, this is how you should do it.
Karl

"Mircea Pleteriu" <mp*******@asp-gmbh.de> wrote in message
news:OX**************@TK2MSFTNGP12.phx.gbl...
I have created an aspx page called Page1. The class associated with the page in code behind is abstract.
Now I want to create another aspx page call Page2 that inherits the Page1.

It seems like the Page2 inherits the code behind defined by Page1 but it
does not inherits the html content (the controls) of the Page1.
So, I do not have the controls on my new page.

Can somebody tell me where I am wrong?

Nov 17 '05 #3
Hi,

If you don’t care about the visualization of HTML controls in design
mode you can add them dynamically in your base class (onload) and they
will be create in derived classes (webforms)

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #4
Hi,

If you don’t care about the visualization of HTML controls in design
mode you can add them dynamically in your base class (onload) and they
will be create in derived classes (webforms)

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BK | last post by:
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...
5
by: Invalidlastname | last post by:
Hi, I just read the pattern "Design and Implementation Guidelines for Web Clients" from MSDN. Here is my question. In chapter 3,...
7
by: tshad | last post by:
I have a control that I am using from Metabuilders that requires you to use: <%@ Page Inherits="MetaBuilders.WebControls.DialogPage" %> How do I inherit my code-behind page or another object...
2
by: BK | last post by:
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...
3
by: Pini | last post by:
Hi all,In asp.net 1.x i creates a basepage that extends System.Web.UI.Page class. I created this file in a web appplcaition project and then refernced it from another projects. All the pages in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.