A
Alex Maghen
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
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