473,834 Members | 1,879 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 1535
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
1339
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
7072
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
1365
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
2657
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
1690
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
1263
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
6624
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
1773
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
1904
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
9646
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10793
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10510
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
10548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5627
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
5794
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
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
3
3081
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.