newbie: css in every page in app

M

Martin Knott

First, I hope I've posted in the right group.

So, to the problem.

I'm building an app and I want to use inheritance withthe pages so that
common elements are included at the base level. All goes well up to now,
the generic page adds the standard components (nav links and banner) and
the children then add their specific information.

The problem is, how can I add a reference to the CSS stylesheet in the
Head section of each derived page? I don't want to add it explicitly to
each page.aspx file. I would rather add it to the base, but it seems
that the base.aspx isn't parsed. I've tried to get around this by
completely removing the head section from childpage.aspx and using the
InitializeComponent method of basepage to add the "<!DOCTYPE.....through
to <body>" header information including the css link. The problem then
is that I don't know where to add the closing tags for the body and the
html.

I understand that ASP 2.0 tries to solve this kind of thing with Master
pages. What's the proper 1.0 way to do this? Just manually add css
links? (Hopefully not, since I was thinking of storing the users style
preference and then dynamically using it for the app)

Thanks in advance, sorry if I'm in the wrong group or my problem was
unclear.

Martin
 
M

Martin Knott

Thanks Eirik,

I was doing too at first. Then I needed to add CSS links to each "head"
section of the html. I also wanted to have different css sheets for
different logged on users.

The other problem was that the header was to have a "search" button. I
ended up in a mess with 2 form tags and so on. If you're interested I
found what I think is a good example:

http://www.dotnetjunkies.com/Tutorial/95EBDB54-B8D2-4D33-9DC2-C246793A3A77.dcik

In this you have to code all the controls by hand, rather than drag and
drop. The idea is that the base page has prebuilt containers
(representing Banner, NavBar, Content etc) within the html tags. You
code your child to add controls to these containers. The beauty is that
you get control over both the html head and body. I wish I'd have found
that site 24 hours ago....

cheers

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top