I have a need to allow users to select the theme you want to use and save in their profile. I am aware of the ability to set the them for individual pages and have a function to do so (see below):
Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
Dim strTheme As String = DataManager.GetUserTheme(User.Identity.Name.ToString)
If Theme <> Nothing Then
Page.Theme = strTheme
End If
End Sub
However, I have not been able to find a way to set the Theme for all pages so I don't have to add the above code to all the pages on my site. Furthmore, adding the code to the MasterPages wouldn't work because MasterPages do not have PreInit methods.
Any ideas? I have see the question asked several times, but it always goes back to setting the theme for individual pages. What am I missing?
Thanks,