Creating a new page

Topics: ASP.NET 2.0, Themes
Feb 27, 2011 at 1:05 PM
Edited Feb 27, 2011 at 1:06 PM

Im trying to integrate a new page into blog engine, but i can only get it to work if i add the  MasterPageFile="~/themes/MyTheme/site.master" code to it. While it works like this, it only works for one theme and i want it to work for all themes.



Here is the code:


<%@ Page Title="" Language="C#" MasterPageFile="~/themes/MyTheme/site.master" AutoEventWireup="true" CodeFile="clothing.aspx.cs" Inherits="clothing" %>

<%@ Import Namespace="BlogEngine.Core" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">
    <div id="clothing">
        <div class="mainBanner">

Feb 27, 2011 at 7:13 PM

In clothing.aspx.cs, the "clothing" class should inherit from BlogEngine.Core.Web.Controls.BlogBasePage.  So the class declaration you have towards the top of clothing.aspx.cs should look like:

public partial class clothing : BlogEngine.Core.Web.Controls.BlogBasePage

By inheriting from BlogBasePage, BlogBasePage will dynamically set the theme at runtime.