Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 9th, 2008, 04:45 AM
Authorized User
 
Join Date: Dec 2004
Posts: 69
Thanks: 0
Thanked 5 Times in 5 Posts
Send a message via Yahoo to whiterainbow
Default

I explain it properly.... You seen all the color buttons and the button event there and the session variable is assigned whenever the button event is executed. So for example, by default I am assigning the white theme in the preinit event. Whenever the page is loaded for the first time the white theme will be applied... Now I clicked on green theme but it didn't take effect. Again I pressed the Green theme and the theme is applied... This is the problem I am facing, and the "Only" means the last two sentences...

Thanks and Regards,

Senthil Kumar M.
 
Old April 9th, 2008, 04:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If I understand you correctly, I believe you hit a timing issue.

Button_Click fires later than preinit. So, in PreInit you set the theme you previously assigned to a session variable. Then the button's click fires, and the new value is stored in session, but *not* applied to the theme. Then you hit another button, the theme in PreInit is set to the *previously* selected theme and then the new value is stored in session state. And so on and so forth; you're always one step too late.

The solution: redirect to the same page after you have stored the theme in session state. That way, PreInit fires for a new request and the correct theme is applied.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old April 9th, 2008, 05:24 AM
Authorized User
 
Join Date: Dec 2004
Posts: 69
Thanks: 0
Thanked 5 Times in 5 Posts
Send a message via Yahoo to whiterainbow
Default

Thanks Imar....I'll try this way to get the themes applied...

Thanks and Regards,

Senthil Kumar M.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Theme not sticking... gymwalker ASP.NET 3.5 Basics 4 November 14th, 2008 04:17 PM
Setting the style sheet of the Master Page dotnetDeveloper BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 August 4th, 2008 09:56 AM
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
Theme Selector wont pick up other theme Tawanda BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 May 4th, 2007 08:44 AM
page theme zhugeliang ASP.NET 2.0 Basics 1 January 9th, 2007 02:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.