Forum Add-on

Topics: Developer Forum
Nov 4, 2008 at 4:02 PM

Hi, I am new to N2, I need help to install the Forum add-on.
I Followed the install instructions:
In the Config.web file, on the wwwroot directory i added a line,

<section name="yafnet" type="yaf.SectionHandler,yaf" />

inside the config sections, SectionGroup.

Before the end of N2 section i added the follow...

<yafnet configSource="yafnet.config" />

After that, using  n2 (template project), when i create a new page, i am able to view the Forum Page.
After created a forum page with the default parameters  the error was:

Object reference not set to an instance of an object.

File di origine: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\0d7a33ce\a0863df5\App_Web_aay4v4sa.0.cs    Riga: 0

Analisi dello stack:

[NullReferenceException: Object reference not set to an instance of an object.]
   N2.Templates.Forum.UI.Views.Forum.Page_Error(Object sender, EventArgs e) +433
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.TemplateControl.OnError(EventArgs e) +8686090
   System.Web.UI.Page.HandleError(Exception e) +84
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6776
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.forum_ui_views_forum_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\0d7a33ce\a0863df5\App_Web_aay4v4sa.0.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

 
I tried another one time, but in the connection string i used the same connection string in use with n2 templates database (i use Ms sql express)
but the error was the same.

What is wrong?
Is possible to use the forum with the template project?
Or what i need to do after what?

Thank you in advance and sorry for my english...

Nov 6, 2008 at 5:28 AM
You need the add <yafnet configSource="yafnet.config" /> outside the n2 section (so it's just a new section as n2 is).
Nov 6, 2008 at 1:54 PM
mmm.... I tried but the result is the same... Where exactly i have to add the line with yafnet configsource? Can you post an example? I used the latest version of n2 and also the latest version of add-on.

Maybe is necessary a DB configuration before using the page with forum? ... :(
Nov 8, 2008 at 3:26 PM
No, you should be able to perform the database configuration after adding the forum to the page.

you need to add yafnet.config to the root of your web application. Then, use this:

<configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
 <section name="yafnet" type="yaf.SectionHandler,yaf" />
    <sectionGroup name="n2" type="N2.Configuration.SectionGroup, N2">
      <section name="host" type="N2.Configuration.HostSection, N2" requirePermission="false" />
      <section name="engine" type="N2.Configuration.EngineSection, N2" requirePermission="false" />
      <section name="database" type="N2.Configuration.DatabaseSection, N2" requirePermission="false" />
      <section name="edit" type="N2.Configuration.EditSection, N2" requirePermission="false" />
      <section name="templates" type="N2.Templates.Configuration.TemplatesSection, N2.Templates" requirePermission="false" />
    </sectionGroup>
  </configSections>
  
  <!-- Yet Another Forum Configuration -->
  <yafnet configSource="yafnet.config" />
Nov 9, 2008 at 2:01 PM

Great, now is OK! Thank you.

... the installation is ok, but the forum doesn't works...
 
After putting the forum in the site, appear the installation form of Forum, when i press the button "Next" an error occour, the displayed page was:

The format of input string was incorrect!

Formato della stringa di input non corretto.

[FormatException: Formato della stringa di input non corretto.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7467367
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
   System.Int32.Parse(String s) +23
   yaf.install._default.Page_Load(Object sender, EventArgs e) +380
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


I suppose something about the local, i use italian local ... I have to investigate...

Thanks

Nov 12, 2008 at 2:02 PM
Did you find the problem. Was it a YAF related problem or is there something wrong with the add-in?
Nov 12, 2008 at 2:45 PM
I don't know, i tried to change my local, in english format but the error persist.
I suppose the problem is about the forum (YAF) but at the moment i haven't enought time to check the code of forum add-in.
In every case thank you.
Jul 24, 2010 at 2:41 AM

I am having this issue as well.  Has anyone found a solution?

Aug 24, 2010 at 12:13 PM

Hi there,

I'm building an MVC site and I'm trying to integrate the forum add-in. I've been wrestling with the forum for the last couple of days and after re-compiling the add-in to remove the dependency on N2.Templates.dll and following all of the steps in the Installation.txt file I'm stuck with the forum not showing up. I get a 403 error when I  navigate to the forum:

HTTP Error 403.14 - Forbidden

From what I could find out it seems the problem is in the fact that the forum is based on WebForms and the containing application is MVC-based. The site is part of a Windows Azure solution and some of the things I read suggest the local IIS may not be correctly configured. However, right-clicking on the Forum.aspx page and selecting "View in browser" shows the page just fine, including navigating to subsequent pages from the YAF installation wizard. Running pure WebForms apps on the local IIS also goes without problems, so I think IIS is not the cause for YAF not showing up.

Please, if someone has any idea for solving this problem, or has done similar integration of YAF in an MVC site, let me know.

Thanks!

 

Aug 24, 2010 at 6:09 PM

I ended up not using N2 CMS but using Umbraco.  The method I used here might work for N2:

I created a root master page called BBS and added <umbraco:Macro Alias="SForum" runat="server"></umbraco:Macro>

I then created a user control in usercontrols/forum/forum.ascx

Code behind:

protected void Page_Load(object sender, EventArgs e)

{

Exception x = Server.GetLastError();

YAF.Classes.Data.DB.eventlog_create(YafServices.InitializeDb.Initialized ? (int?)YafContext.Current.PageUserID : null, this, x);

YAF.Classes.Core.CreateMail.CreateLogEmail(x);

}

Ascx page

<%@ Control Language="C#" Debug="true" AutoEventWireup="true" CodeFile="forum.ascx.cs" Inherits="usercontrols_forum" %>

<%@ Register TagPrefix="YAF" TagName="ForumWelcome" Src="~/controls/ForumWelcome.ascx" %>

<%@ Register TagPrefix="YAF" TagName="ForumIconLegend" Src="~/controls/ForumIconLegend.ascx" %>

<%@ Register TagPrefix="YAF" TagName="ForumStatistics" Src="~/controls/ForumStatistics.ascx" %>

<%@ Register TagPrefix="YAF" TagName="ForumActiveDiscussion" Src="~/controls/ForumActiveDiscussion.ascx" %>

<%@ Register TagPrefix="YAF" TagName="ForumCategoryList" Src="~/controls/ForumCategoryList.ascx" %>

<%@ Register TagPrefix="YAF" TagName="ShoutBox" Src="~/controls/ShoutBox.ascx" %>

<YAF:Forum runat="server" id="forums" ViewStateMode="Enabled" BoardID="1" Visible="true" />

I then created a pages called Message Boards and set the template to BBS.

I also added a url redirect

<add name="YafRewrite" virtualUrl="forums.aspx(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="Message-Boards.aspx?$1" ignoreCase="true" />

When adding the Macro to the template I created it works just fine.

But if I add that macro to a sub template such as textpage, I get error after error

From: thpetkov [mailto:notifications@codeplex.com]
Sent: Tuesday, August 24, 2010 4:13 AM
To: mskurnik@gmail.com
Subject: Re: Forum Add-on [n2cms:39179]

From: thpetkov

Hi there,

I'm building an MVC site and I'm trying to integrate the forum add-in. I've been wrestling with the forum for the last couple of days and after re-compiling the add-in to remove the dependency on N2.Templates.dll and following all of the steps in the Installation.txt file I'm stuck with the forum not showing up. I get a 403 error when I navigate to the forum:

HTTP Error 403.14 - Forbidden

From what I could find out it seems the problem is in the fact that the forum is based on WebForms and the containing application is MVC-based. The site is part of a Windows Azure solution and some of the things I read suggest the local IIS may not be correctly configured. However, right-clicking on the Forum.aspx page and selecting "View in browser" shows the page just fine, including navigating to subsequent pages from the YAF installation wizard. Running pure WebForms apps on the local IIS also goes without problems, so I think IIS is not the cause for YAF not showing up.

Please, if someone has any idea for solving this problem, or has done similar integration of YAF in an MVC site, let me know.

Thanks!

Read the full discussion online.

To add a post to this discussion, reply to this email (n2cms@discussions.codeplex.com)

To start a new discussion for this project, email n2cms@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Aug 25, 2010 at 10:06 AM

Hi mskurnik,

Thanks for the instructions and code you posted. I will give it a try and will post here if I have any success with that.