• Posts: 2
  • Joined: 03/02/2012

I am new to yaf, what is the best way to create a custom page in yaf?

  • Posts: 148
  • Joined: 28/05/2008

There are a few tips you need to know. It depends on what type of page and where you want to add it, but YAF .ASCX pages inherit from ForumPage or ForumPageRegistered (the latter for pages within a user profile typically.)

So when creating a page, inherit from one of those. Example:

namespace YAF.Pages
    // YAF.Pages
    #region Using


    /// <summary>
    /// Summary description for customPage.
    /// </summary>
    public partial class customPage : ForumPage

Second, add the page to YAF.Types.Constants.ForumPages, like so

namespace YAF.Types.Constants
  /// <summary>
  /// List of all pages available in the YAF forum
  /// </summary>
  public enum ForumPages

Then you can link to the page like this:

string.Format("<a href={0}>{1}</a>", YafBuildLink.GetLink(ForumPages.customPage), "My Custom Page");



There could be a far simpler way that one of the YAF Gurus knows that I don't. :)

Hope that helps,
  • Posts: 2
  • Joined: 03/02/2012
Dave, Thanks a million, that was great help. I am little surprise that their isn't much documentation on the topic.

  • Posts: 9
  • Joined: 14/10/2013
Thanks,i solved that issue .
your comments are very useful.
Thanks alot Smile
  • Posts: 15
  • Joined: 14/11/2013
thanks works perfectly
the signature
Users browsing this topic
    Forum Jump  
    • You cannot post new topics in this forum.
    • You cannot reply to topics in this forum.
    • You cannot delete your posts in this forum.
    • You cannot edit your posts in this forum.
    • You cannot create polls in this forum.
    • You cannot vote in polls in this forum.

    About Us

    The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

    Powered by Resharper Donate with PayPal button

    Project Twitter Updates

    Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved