Typically, to render HTML to the <HEAD> or <BODY> tags, or any other tag
that sits outside of a WebForm, you would do 2 things:
1. Add runat=server and an id to the tag in the Page Template
2. Add the CodeBehind class (HtmlGenericControl) to the CodeBehind.
The Page Template is incomplete without the CodeBehind class from which it
is derived. The problem in your case is that if you want these to be in an
inherited class, you're still going to have to add them in manually to each
Page Template that uses the CodeBehind. Although this would be a bit dodgy,
I believe it would work. Since it has to be added to each Page Template in
any case, an alternative would be to simplify your inherited Page class to
leave this out, and add it only to the Pages that need it.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Big D" <a@a.com> wrote in message
news:OP*************@TK2MSFTNGP10.phx.gbl...
Is there any way to, from the page class, send literal output to the
<HEAD> of te page, or within the <BODY onload="('theFunctionIAddedToTheHead');">
? I need to do this in a class that inherrits from PAGE, but is an abstract
class for the pages of my site. I.E.
System.Web.UI.Page -> myBasePage
All pages in the site inherit from myBasePage, and will be able to use
funciton is myBasePage to modify content in the HEAD tag.
I've looked into inherriting from a class that totally overrides the base
pages' render method, but this is, quite honestly, a little scary to me
because it require re-creating the form entirely.
Ideas are greatly appreciated!
tnx
D