ASP.NET 2.0 Themes, CSS and Master Pages Questison

Discussion in 'ASP .Net' started by Ryan Ternier, Dec 1, 2005.

  1. Ryan Ternier

    Ryan Ternier Guest

    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.
     
    Ryan Ternier, Dec 1, 2005
    #1
    1. Advertisements

  2. Ryan Ternier

    Scott Allen Guest

    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.
    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 Allen, Dec 2, 2005
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.