473,804 Members | 3,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Standard Page - Inheritance...

Hello, my company has a standard format that I must follow when creating a
page.
The top portion of the page contains a standard heading which should be
placed on each page. This "heading" has a form and some javascript which has
"action" which invokes some javascript.
I am trying to figure out how I can standardize this so that I do not have
to copy this code to each and every page. I thought I might be able to use a
"User Control", but I do not think I can do this because it would involve
another form and I am not too sure if one form can contain another form. I
think you can have more then one form provided that only one of them is
marked with a "runat=serv er". But I do not think one form can contain
another form.

Can I create a base page with all of this code in it and them inherit that
page on subsequent pages? I am not quite sure how you would do this
inheretance ...you would have an "aspx" page and then you would have your
code behind on the base page a "aspx.cs". When you create your first page
what statement would you place in that page to inherit from the base page?
Is there some property you can set in Visual studio to tell it that all new
pages which are create will inherit from this base page? The base page would
or would not contain the form with the runat parameter?

Thanks in advance for your assistance....
Nov 19 '05 #1
3 1195
Hi Jim,

You might want to take a look at ASP.Net 2.0 (whidbey). It has a new item
called "Master Pages" which sounds exactly like what you want. Otherwise,
you will have to go with Controls that are used in all pages. The current
version of ASP.Net does not support visual inheritance.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Jim Heavey" <Ji*******@disc ussions.microso ft.com> wrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hello, my company has a standard format that I must follow when creating a
page.
The top portion of the page contains a standard heading which should be
placed on each page. This "heading" has a form and some javascript which
has
"action" which invokes some javascript.
I am trying to figure out how I can standardize this so that I do not have
to copy this code to each and every page. I thought I might be able to
use a
"User Control", but I do not think I can do this because it would involve
another form and I am not too sure if one form can contain another form.
I
think you can have more then one form provided that only one of them is
marked with a "runat=serv er". But I do not think one form can contain
another form.

Can I create a base page with all of this code in it and them inherit that
page on subsequent pages? I am not quite sure how you would do this
inheretance ...you would have an "aspx" page and then you would have your
code behind on the base page a "aspx.cs". When you create your first
page
what statement would you place in that page to inherit from the base page?
Is there some property you can set in Visual studio to tell it that all
new
pages which are create will inherit from this base page? The base page
would
or would not contain the form with the runat parameter?

Thanks in advance for your assistance....

Nov 19 '05 #2
Jim Heavey wrote:
Can I create a base page with all of this code in it and them inherit that
page on subsequent pages? I am not quite sure how you would do this
inheretance ...you would have an "aspx" page and then you would have your
code behind on the base page a "aspx.cs". When you create your first
page
what statement would you place in that page to inherit from the base page?
Is there some property you can set in Visual studio to tell it that all
new
pages which are create will inherit from this base page? The base page
would
or would not contain the form with the runat parameter?

Thanks in advance for your assistance....


You might be able to use the page template concept at:

http://www.wilsondotnet.com/Demos/Generator.aspx

In the "template" dropdown box, select "Direct Render", then click the
"Generate Code" button a little ways down the page.

Ben
Nov 19 '05 #3
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:ej******** ******@TK2MSFTN GP10.phx.gbl...
Hi Jim,

You might want to take a look at ASP.Net 2.0 (whidbey). It has a new item
called "Master Pages" which sounds exactly like what you want. Otherwise,
you will have to go with Controls that are used in all pages. The current
version of ASP.Net does not support visual inheritance.
Clarification: that last sentence means that you'll have problems in Design
mode if you inherit from a base page.

John Saunders
--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.

"Jim Heavey" <Ji*******@disc ussions.microso ft.com> wrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hello, my company has a standard format that I must follow when creating
a
page.
The top portion of the page contains a standard heading which should be
placed on each page. This "heading" has a form and some javascript which
has
"action" which invokes some javascript.
I am trying to figure out how I can standardize this so that I do not
have
to copy this code to each and every page. I thought I might be able to
use a
"User Control", but I do not think I can do this because it would
involve
another form and I am not too sure if one form can contain another form.
I
think you can have more then one form provided that only one of them is
marked with a "runat=serv er". But I do not think one form can contain
another form.

Can I create a base page with all of this code in it and them inherit
that
page on subsequent pages? I am not quite sure how you would do this
inheretance ...you would have an "aspx" page and then you would have your
code behind on the base page a "aspx.cs". When you create your first
page
what statement would you place in that page to inherit from the base
page?
Is there some property you can set in Visual studio to tell it that all
new
pages which are create will inherit from this base page? The base page
would
or would not contain the form with the runat parameter?

Thanks in advance for your assistance....


Nov 19 '05 #4

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

Similar topics

1
1777
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 following: System...Page | MyBasePage |------------------|--------------------| CategoryPageOne CategoryPageTwo CategoryPageThree | | |
5
2051
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, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/diforwc-ch03.asp , the article mentions using page inheritance to maintain common page layout. We currently use page inheritance approach to segment the function areas. In each function area, there is a base page to provide the common...
3
1928
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 this project inherited from this new BasePage ionstead of the Page class. In asp.net 2.0 i dont seem to make this work. I did the same thing. precompile the project and then added refernce to the assemblies in the precompiled directory.
32
2747
by: Stephen Horne | last post by:
I've been using Visual C++ 2003 for some time, and recently started working on making my code compile in GCC and MinGW. I hit on lots of unexpected problems which boil down to the same template issue. A noddy mixin layer example should illustrate the issue... class Base { protected: int m_Field;
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.