My little project of making a ASP.NET website with YAF linked forums was going smooth, until I got to the part of making YAF a child page of the site.
If you go to this
link you'll see a header with the links below.
Home - Forum - GameDay Chat - Latest News - Links
All of them work as desired, except Forum. The Forum link (YAF Default.aspx renamed to Forum.aspx) breaks out into it's own parent page rather than being a child page like, GameDay Chat - Latest News - Links.
I tried adding Site.Master to Forum.aspx and that failed because Forum.aspx is not a content page.
Show Spoiler
<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" ValidateRequest="false" Inherits="YAF.ForumPageBase" %>
<%@ Register TagPrefix="YAF" Assembly="YAF" Namespace="YAF" %>
<script runat="server">
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="YafHead" runat="server">
<meta id="YafMetaScriptingLanguage" http-equiv="Content-Script-Type" runat="server"
name="scriptlanguage" content="text/javascript" />
<meta id="YafMetaStyles" http-equiv="Content-Style-Type" runat="server" name="styles"
content="text/css" />
<meta id="YafMetaDescription" runat="server" name="description" content="Yet Another Forum.NET -- A bulletin board system written in ASP.NET" />
<meta id="YafMetaKeywords" runat="server" name="keywords" content="Yet Another Forum.net, Forum, ASP.NET, BB, Bulletin Board, opensource" />
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width,user-scalable=yes"/>
<title></title>
</head>
<body style="margin: 0; padding: 5px">
<form id="form1" runat="server" enctype="multipart/form-data">
<YAF:Forum runat="server" ID="forum" BoardID="1">
</YAF:Forum>
</form>
</body>
</html>
[HttpException (0x80004005): Content controls have to be top-level controls in a content page or a nested master page that references a master page.]
System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8965627
System.Web.UI.Page.get_Master() +54
System.Web.UI.Page.ApplyMasterPage() +15
System.Web.UI.Page.PerformPreInit() +45
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +328
My goal here is to have my own Header/Footer throughout the site, as well as my own custom pages that I'll develop as needed/wanted.