YAFLogo

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
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.

<%@ 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

Error wrote:

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.

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago
Take a look at my asp.net sample app that has yaf included as a control, or did you already used that?

http://forum.yetanotherforum.net/yaf_postsm51411_Integrating-YAF-1-9-5-5-into-existing-application--Walkthrough.aspx#post51411 

That should give you a good starting point.

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
This looks to be exactly what I'm aiming to develop.

I'm uploading the bin (DLL's only), forum, and Styles directories as well as the ASPX pages right now.

Edit, okay it's working as desired. I tried it out before all the files were uploaded and it still worked. I'm thinking all I may have needed was the Forum.aspx from your sample?

Also, what would be required to update this to the latest version (when released)? Same process as if it were in the root, but simply put the files in /forum instead and put the DLL's in /bin?

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.0 rc 2
11 years ago

Edit, okay it's working as desired. I tried it out before all the files were uploaded and it still worked. I'm thinking all I may have needed was the Forum.aspx from your sample?

Originally Posted by: Zero2Cool 

Yes and also the app.config

<add key="YAF.BaseScriptFile" value="forum.aspx" />
  <add key="YAF.ForceScriptName" value="forum.aspx" />

Also, what would be required to update this to the latest version (when released)? Same process as if it were in the root, but simply put the files in /forum instead and put the DLL's in /bin?

Originally Posted by: Zero2Cool 

Correct its the same process.

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader Topic Starter YAF Version: YAF 3.1.16
11 years ago
Functionality wise, I have everything done. Now I'm working on some CSS issue stuff. Thanks a lot, I really appreciate it.