How to Override a private set property?

'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:

Ricky at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.