473,722 Members | 2,205 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Themes Change onfly

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.

I am trying to set in one place for the entire application. Instead of
specifying in all pages.
Page_PreInit method and Page.Theme="" code.

I am using single Master page, I thought if I setup for Master page It
will apply to the entire site. But In Page_PreInit method for Master
mentioned above code. It is not working.

Can any one tell which is the better way to do this one.
Thanks
Suresh

Jun 2 '06 #1
2 2651
The master page doesn't have any PreInit event.

Make a base class where you override PreInit, then you just let all your
pages inherit that class instead of Page:

public class ThemedPage : Page {
// override PreInit here
}
su***********@g mail.com wrote:
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.

I am trying to set in one place for the entire application. Instead of
specifying in all pages.
Page_PreInit method and Page.Theme="" code.

I am using single Master page, I thought if I setup for Master page It
will apply to the entire site. But In Page_PreInit method for Master
mentioned above code. It is not working.

Can any one tell which is the better way to do this one.
Thanks
Suresh

Jun 3 '06 #2
Yes, that's how its usually done. And then you need to write a bunch of code
to maintain the selection across sessions :-)

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/

"Göran Andersson" <gu***@guffa.co m> wrote in message
news:eU******** ******@TK2MSFTN GP04.phx.gbl...
The master page doesn't have any PreInit event.

Make a base class where you override PreInit, then you just let all your
pages inherit that class instead of Page:

public class ThemedPage : Page {
// override PreInit here
}
su***********@g mail.com wrote:
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.

I am trying to set in one place for the entire application. Instead of
specifying in all pages.
Page_PreInit method and Page.Theme="" code.

I am using single Master page, I thought if I setup for Master page It
will apply to the entire site. But In Page_PreInit method for Master
mentioned above code. It is not working.

Can any one tell which is the better way to do this one.
Thanks
Suresh

Jun 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1752
by: clintonG | last post by:
Does anybody know how to use a control such as the DropDownList to change Themes when using MasterPages? I'm also asking in the forum. <%= Clinton Gallagher METROmilwaukee (sm) "A Regional Information Service" NET csgallagher AT metromilwaukee.com URL http://metromilwaukee.com/ URL http://clintongallagher.metromilwaukee.com/
1
1532
by: Ryan Ternier | last post by:
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...
12
1378
by: Michael | last post by:
Hello, I'm starting to use Themes. I skin some Web controls, like a WebPart and a CatalogPart. While browsing my Web page, I can see that the Theme is working, in VS 2005, in design view, I don't see the Theme styles being applied. Neither are the properties reflected in the Properties window. Am I doing something wrong? Should the skin properties be reflected in the Properties Window and in the Design view. I do hope so, because...
0
1492
by: Full Decent | last post by:
Hey again! In my quest to make proper use of OO PHP I would like to ask for a critique of the current method of doing themes in the Camera Life (http://fdcl.sf.net) software and see if an OO approach is more appropriate. This program consists of multiple PHP pages that include a common.php file. My motivation is to make making themes easier, so we can get more theme contributors! Themes consist of image files, a css file and a PHP...
1
1337
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...
4
1682
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...
6
2492
by: Clinton Farleigh | last post by:
Hi, I was going to ask a question, but I think I've answered it so now I am going to rant about how crappy ASP.NET themes are instead. As I've indicated above, my problem today is with themes. Per microsoft "Only one theme can be applied to each page. You cannot apply multiple themes to a page, unlike style sheets where multiple style sheets can be applied."
11
6614
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
1767
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...
0
9234
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
9151
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
9086
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8042
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...
1
6680
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
5994
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
4501
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...
1
3207
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
2146
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.