I was looking at Blogengine.NET today and he has an interesting setup for Themes, figured I wanted to do something similar, however.. I can’t make it work at all.
For each theme he has a folder like:
/themes/Indigo/
/themes/Standard/
/themes/Mobile/
Each theme contains a site.master and they all have their own codebehind that looks like this:
public partial class site : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { } }
Was wondering how he could have one Page_Load for each theme in 3 different places, all beeing partial classes of ‘site’, but I gave it a shot in my VB.NET application and just as I thought it didn’t work
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) has multiple definitions with identical signatures
I’m pretty new to this but is there a way to make this work or is it something that just works in C#?
I would like to get different masterpages and usercontrols with something like this:
MasterPageFile = '~/MasterPages/' & Theme & '/Site.master' uc = LoadControl('~/UserControls/' & Theme & '/Box.ascx')
Or is there a better way to accomplish this?
Thanks!
Found the solution so I’ll post it here if anyone else is looking for the same thing.
Multiple identical masterpages works in a .NET Web Site but not in a .NET Web Application. Maybe someone else can explain why, I just know that’s the case.
So this works in a .NET Web Site:
But it won’t work in a .NET Web Applications since there can only be one site.master.
Makes me wonder if there is another good way to stick with Web Application but still be able to do major theming like WordPress or Blogengine.NET