By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,925 Members | 732 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,925 IT Pros & Developers. It's quick & easy.

ASP.NET 2.0 Themes, CSS and Master Pages Questison

P: n/a
I have just started playing around with ASP.NET 2.0 and have a few questions
I couldn't get answers to on the net.

If anyone could help me with these it'd be awesome.
---
Themes - THey seem to lack full functionality with CSS files.

I have a theme set up. Inside that theme I can have 32 CSS files. Each file
is for each page within that theme. Why? I find it easier having multiple
small CSS files to work with rather than a few HUGE ones. It seems to me
that every content page will incorporate every CSS file in that theme.

Sure i can work with it seeing you shouldn't be referencing controls by ID
(which is another issue below... but I think I know why), but it's still
bad. If I have:

<div class="header"></div> on one page and on another i have the same, I
might want them different on each page, but with the way the styles are
loaded, I can't have .header {...} defined in multiple CSS files under the
same theme.

Now if there is a way to do this, I'd love to learn how :D.
---
Content Pages - Master Pages.

I think I know why it does this... but I might be off base.

..NET will change the ID's given to controls within a master page. Now, this
is sort of understandable because in my mind .NET will treat each content
page as a seperate control / object. A master page might have multiple
content pages rendered in it at once, so it'd need to change ID's to make
sure they're unique.

understandable.... but why would it need to change ID's in the base master
page? I find it difficult when I want to reference controls by ID's in CSS
files only to have their ID's changed.
Any help with these would be awesome. I spent a long time trying to find
answers with google / forums but no one really knows...

Thanks.
Dec 1 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 1 Dec 2005 09:05:11 -0800, "Ryan Ternier"
<rt******@icompasstech.com> wrote:

<div class="header"></div> on one page and on another i have the same, I
might want them different on each page, but with the way the styles are
loaded, I can't have .header {...} defined in multiple CSS files under the
same theme.

So, you have a stylesheet per page. Do you still use multiple themes?
If you have two theme directories do you create another 32 style
sheets?

I'm thinking themes may not be what you want to use at all. Themes are
about providing a consistent UI across multiple pages. If you want a
different look for each page in an application, I don't think themes
will help - you'll be swimming upstream.

understandable.... but why would it need to change ID's in the base master
page? I find it difficult when I want to reference controls by ID's in CSS
files only to have their ID's changed.


I'd be very, very reluctant to reference an ASP.NET control by ID in
CSS. If you make some changes to the page the ID can change and the UI
is broken. I'd stick to using a class name.

--
Scott
http://www.OdeToCode.com/blogs/scott/
Dec 2 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.