Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Do Masterpages have a PreInit event?

 
Thread Tools Search this Thread
Old 09-28-2006, 05:01 PM   #1
Default Do Masterpages have a PreInit event?


I have this code. The preinit never fires:

public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Label1.Text = Profile.FullName;
}
}
protected void Page_PreInit(object sender, EventArgs e)
{
Response.Write("HI");
Page.Theme = Profile.MyTheme;
}
}

If I can't have a preinit in my masterpage, how can I dynamically set
the theme for all the pages based upon that theme? Thanks for any help.



needin4mation@gmail.com
  Reply With Quote
Old 09-28-2006, 05:23 PM   #2
Mark Rae
 
Posts: n/a
Default Re: Do Masterpages have a PreInit event?

<> wrote in message
news: ups.com...

> If I can't have a preinit in my masterpage, how can I dynamically set
> the theme for all the pages based upon that theme?


MasterPages don't have a PreInit method natively.

However, this is not a particularly difficult thing to achieve using
inheritance:
http://www.google.co.uk/search?sourc...+inherit+theme


  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump