There is not PreInit event in the MasterPage.MasterPage actualy is a UserControl which dosen't has PreInit.
Adding method Page_PreInit doesn't also mean that there is an event named PreInit on masterpage. to prove that, try to add:protected override OnPreInit(...), the compiler will not accept it.
To solve your issue, I suggest to create class Named BasePage or what ever which inherits from System.Web.UI.Page. Make all your Pages Inherits from it. and add your Page_PreInit on it, then set your MaterPage in this event.
Thanks to Muhammad Mosa: http://www.velocityreviews.com/forums/t362567-pagepreinit-no-execute-in-masterpage.html
No comments:
Post a Comment