473,603 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET 2.0 Themes, CSS and Master Pages Questison

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
1 1527
On Thu, 1 Dec 2005 09:05:11 -0800, "Ryan Ternier"
<rt******@icomp asstech.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1334
by: Seefor | last post by:
I may be missing something, but why aren't master pages part of themes? i.e. why don't they go in the App_Themes or global Themes directory, and be referenced just by name (not full path) in the declaration for a page? That way, you can change the complete layout by just applying the theme to a page or a whole site. I know that if your master pages are XHTML, then you can change the layout significantly with CSS, but there are...
3
7060
by: johannblake | last post by:
I'm reading up on Themes and Master Pages in ASP.NET 2.0 but I cannot seem to understand what the difference between the two are. Do Master Pages essentially end up doing what Themes do? Is Themes an older part of the .NET architecutre and simply included for backward compatibility or are Themes and Master Pages two different things meant to compliment each other? Can someone give me some insight please.
1
1357
by: sbelgrave | last post by:
First off. Hats off to MS to really doing a good job of major fixes on VS 2K5. It is really a lot better. I have begun using Master Pages with Themes but am a bit confused as to how to make the CSS styles in those themes appear during development (not at run time, i know that most forums explain the css files in the themes are merged 'at run time' to make the page you view). I want to use Master Pages w/ Themes but if sadly I feel the...
2
2646
by: suresh.csharp | last post by:
Hi, I have created two themes in our application. Trying to apply themes on fly to the entire application(all pages..) . 1. In web.config file mentioned <pages theme="theme1" />, It is applying for the entire site. 2. In each Page, PreInit event menthod if I mention Page.Theme = Profile.MyTheme; It is applying the theme to which ever pages, I have declared PreInit method with above code.
4
1675
by: Sean | last post by:
My experience now working with master pages on and off for 6 months is that they can be very dangerous when working with themes. One example in particular is the changes I made to my banner menu which now work just fine with all my themes on my development machine but on my production server my non-standard themes are showing effects that are no longer in place even with a complete re-copy of my project. Problems like this with...
0
1256
by: xkeops | last post by:
I have a C# web app ... just playing around with master pages, themes and skins. I have read Scott's article: http://odetocode.com/Blogs/scott/archive/2005/12/09/2604.aspx Still not really clear for me. How can I apply a theme for a master page design app other than static in web config:
11
6608
by: New Bee | last post by:
Hi, I have been looking at Themes and Skins today and now resonably understand how they work at a ground level. But I have a couple of questions. 1. ) StyleSheetTheme I dont understand where this would be used. As I understand it the precidence is like this.
2
1763
by: mike | last post by:
Hi. I am having trouble grasping the concept of applying a consistent theme to an ASP.net website. I didn't used to like ASP because it was too hard to apply a theme from a common theme folder like I could do easily in PHP, but now I see that it has some nicer theming features and master files. So I want to use web.config to switch which theme I'm using, and I want to be able to have several themes. My understanding of themes is that I...
8
1888
by: Jonathan Wood | last post by:
I want to dynamically set my site's theme based on a setting stored in my database. I just hooked this up but get an error that the theme can only be set in the page's PreInit event or earlier. However, it appears that Master pages do not have PreInit events. I REALLY do not want to have to stick the same code in each and every page I create. How are you folks dynamically setting themes from master pages?
0
7996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3951
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.