'Theme' property can only be set in or before the 'Page_PreInit' event (asp.net)?
-
I have themes on my website, and i have image buttons on master page ,onButtonClick theme will change.. But as i click the button which is on master page it gives me error The 'Theme' property can only be set in or before the 'Page_PreInit' event. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: The 'Theme' property can only be set in or before the 'Page_PreInit' event. Source Error: Line 55: Page.Theme = "Black" Line 56: ElseIf imgBtn.ID = "ImgBtnBlue" Then Line 57: Page.Theme = "Blue" Line 58: ElseIf imgBtn.ID = "ImgBtnGrey" Then Line 59: Page.Theme = "Grey" and master page don't have the Pre_Init event ? whats the solution so that themes can be changed on clicking the buttons on master page
-
Answer:
Here's an article explaining how to do this: http://bloggingabout.net/blogs/rick/archive/2007/10/20/howto-set-the-theme-for-a-masterpage-from-code.aspx
Ricky at Yahoo! Answers Visit the source
Related Q & A:
- How can I allow user to create posts in website using ASP.NET?Best solution by Programmers
- How to Undo previous action in asp.net?Best solution by forums.asp.net
- How to Search using jQuery ASP.Net?Best solution by Stack Overflow
- What can Node.js do that ASP.NET cannot?Best solution by Stack Overflow
- How can I fix parser Error in ASP.NET?Best solution by parse.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.