473,383 Members | 1,742 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,383 software developers and data experts.

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=server". 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 1169
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*******@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.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=server". 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***@DIESPAMMERSDIEtakempis.com> wrote in message
news:ej**************@TK2MSFTNGP10.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*******@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.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=server". 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
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,...
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...
32
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...

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.