Skip to content

YAF.NET Integration in to an existing ASP.NET Application

Ingo edited this page Nov 2, 2026 · 12 revisions

Integrate YAF.NET v3 into an existing ASP.NET application

Note

This page is for YAF.NET v3 (.NET Framework 4.8.1, Web Forms). For v4 see Integrate YAF.NET v4 into an existing ASP.NET Core application.

Tip

A complete working example is available as the YAF.NET Sample Application: a standard Visual Studio ASP.NET application with YAF.NET integrated as a control on a page.

Manual integration

  1. Create a folder forum in the root of your application and copy all YAF.NET files and folders into it, except:

    • App_Browsers
    • bin
    • all .config files
  2. Copy the App_Browsers and bin folders into the root of your application.

  3. Merge the YAF.NET .config files into the ones in your application root:

    • web.config: merge the recommended.web.config into your existing web.config.

    • appSettings: set YAF.FileRoot and YAF.AppRoot to the forum folder. The rest is done by the installation wizard when you open the forum for the first time.

      <add key="YAF.FileRoot" value="~/forum" />
      <add key="YAF.AppRoot" value="~/forum" />
  4. To show the forum inside your own page (e.g. with your master page), create a page in the forum folder. Register the YAF.NET controls at the top:

    <%@ Register TagPrefix="YAF" Namespace="YAF.Web.Controls" Assembly="YAF.Web" %>

    and add the forum control where the forum should appear:

    <YAF:Forum runat="server" ID="forum" BoardID="1" />

    Otherwise you can use the existing default.aspx in the forum folder.

  5. Open the page you created, e.g. https://www.yourwebsite.com/forum/forumtest.aspx, or https://www.yourwebsite.com/forum/. Follow the steps of the installation wizard, which connects to your database and sets up the forum.

Clone this wiki locally