Page_PreInit and events

malang

New Member
I have a question...if I have an asp:Button on my page, and I want that button, when clicked, to switch the masterpage, that would be impossible right?Impossible because switching the masterpage needs to happen in Page_PreInit...but the button click event doesn't happen until after code in Page_PreInit is executed.So if I had this in my Page_PreInit block:\[code\]If buttonWasPressed Then Me.MasterPageFile = "newMaster.master"end If\[/code\]It would never get executed. So how can one change the master page file with the click of a button?Thanks!
 
Back
Top