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

Common, Global Web Page Control

Let's say I am building a web site that will have many
ASPX pages and I want to implement a lot of common page-
level functionality globally (centrally). Examples
include:
* Setting the TITLE from central code.
* Setting Style Sheet File (.CSS) for every page.
* Inserting various user web controls on every page.
* Inserting client-side JScript, etc. on every page.
* etc.

For some of this stuff, I guess I can create a web
control that I put on every page (can such a component
set its parents' TITLE and CSS attributes? Guess so).

Also, I think I can put code into my Global.asax that
will automatically insert HTML at the top of or bottom of
every page sent out (this one seems very nasty to me).

I want to know what the most elegant way is to do this
and if there are any examples I could look at. One thing
I had considered is, is there any way of maybe overrding
the Page Class and then having my ASPX files be an
implementation of THAT ("MyPage" class) instead of the
base "Page" class? Anyway, how do I do this stuff?

Thanks.

Alex
Jul 19 '05 #1
2 1411
http://www.aspfaq.com/5002

Ray at work

"Alex Maghen" <al**@maghen.com> wrote in message
news:05****************************@phx.gbl...
Let's say I am building a web site that will have many
ASPX pages and I want to implement a lot of common page-
level functionality globally (centrally). Examples
include:
* Setting the TITLE from central code.
* Setting Style Sheet File (.CSS) for every page.
* Inserting various user web controls on every page.
* Inserting client-side JScript, etc. on every page.
* etc.

For some of this stuff, I guess I can create a web
control that I put on every page (can such a component
set its parents' TITLE and CSS attributes? Guess so).

Also, I think I can put code into my Global.asax that
will automatically insert HTML at the top of or bottom of
every page sent out (this one seems very nasty to me).

I want to know what the most elegant way is to do this
and if there are any examples I could look at. One thing
I had considered is, is there any way of maybe overrding
the Page Class and then having my ASPX files be an
implementation of THAT ("MyPage" class) instead of the
base "Page" class? Anyway, how do I do this stuff?

Thanks.

Alex

Jul 19 '05 #2
Hi Alex,

Besides your original thoughts, you also can consider creating customized
project items templates for VS.NET. For detail information, you may refer
to this article:

http://www.sellsbrothers.com/writing...ectitemtemplat
es.htm
Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #3

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

Similar topics

8
by: Steve Klett | last post by:
This is probably a commonly asked question, but I can't find a good way to search for it, so I will ask here. I assumed that there had to be an easy way to access a page level variable from a...
6
by: Prince | last post by:
I have a question about the global.asax.cs file. I'm reading info from a database to populate a DataGrid. I read somewhere that the opening of the database should occur in the global.asax.cs...
3
by: Robert Walter | last post by:
I want to user the Page method LoadControl inside the Global.asax.cs but when I instantiate a page and try it I get the following error... System.NullReferenceException: Object reference not set...
15
by: Mark Goldin | last post by:
I have main aspx page with a number of user controls. How can I create a global property that will be visible in every user control? Thanks
2
by: Visual Systems AB \(Martin Arvidsson\) | last post by:
Hi! When i develop my web application i have a set of javascript that is used in several pages. Also the title is the same for all pages. And certain controls have events that are in the...
22
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to...
11
by: Marc | last post by:
Hello. Apologies if this is the wrong group. I have created a class called "page" which i would like to add to the global.asax and then call from any control within the website. I have currently...
23
by: David Colliver | last post by:
Hi, using c#, 1.1 I know that we are not supposed to use global variables etc. in c# I am having a problem, but not sure how to resolve. I did have another post here, but may have over...
5
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
Hi, On ASP 3.0 I was able to create a file conn.vbs where the connection string lines to the db resides in, how can i do the same on ASP.Net? The reason of this is to avoid modify the line in...
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
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.