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.
Regards
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
"ad" wrote:
Hi,
I have set the this.Page.Theme in a MasterPage, but it no affect.
I have set break point at this line, but it never execute.
void Page_PreInit(object sender, System.EventArgs args)
{
this.Page.Theme = "Web";
}
Why?