asp.net - Change the Theme from MasterPage -


I have a masterpage with two image buttons, and two content pages, what do I want, when an image button clicks ----> Theme changes.

I know that the masterpage does not have the "OnPrint" function and the theme needs to be changed inside the "OnPrint" function ...

So there is any solution for this problem? ??

Thanks in advance.

Baher

The following is a process that "booking ASP.NET 4 In VBnet "by C # and IBi Spinners. Note that he uses a dropdownlight to change the theme in the book, but I believe that one such image can be done with the button:

  1. The image button in the masterpage Click the Event button to add the subject name to the cookie when the cookie is set, you are redirected back to the current page.
  2. You will need to create a custom basepage that comes from the page range and make all your pages the successor from this basepage. It is in this basepage that you will override Page_PreInit to load the selected theme based on the value of the cookie. Redirect is to run the code in Page_PreInit to change the theme.

I know that this is not the best option, because you have to make all your pages a new basepage instead of your page.


Comments