YAFLogo

Posted by: youtpout - Saturday, 14 April 2012 18:38:56
Hello, i have integrated forum in masterpage, it worked with v 1.9.6RC1 and 1.9.5.5 but not with v1.9.6.1 error: [code=csharp] [NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.] YAF.Modules.PagePopupForumModule.InitAfterPage() +35 YAF.Modules.SimpleBaseForumModule.ForumControl_AfterForumPageLoad(Object sender, YafAfterForumPageLoad e) +10 System.EventHandler`1.Invoke(Object sender, TEventArgs e) +0 YAF.Forum.OnLoad(EventArgs e) +1211 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Control.LoadRecursive() +146 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 [/code] the code of my page: [code=xml] <%@ Page Title="" Language="C#" MasterPageFile="~/MenuSecondaire.master" AutoEventWireup="true" CodeFile="Forum.aspx.cs" Inherits="Forum" %> <%@ Register TagPrefix="YAF" Assembly="YAF" Namespace="YAF" %>
[/code] Have you any solution?

Posted by: youtpout - Saturday, 14 April 2012 20:50:15
i found the problem and correct him in source code (the page bug when i have script manager in masterpage) in class PagePopupForumModule [code=csharp] /// /// The init after page. /// public override void InitAfterPage() { if (this._errorPopup == null) AddErrorPopup(); this._errorPopup.Title = this.GetText("COMMON", "MODAL_NOTIFICATION_HEADER"); this.CurrentForumPage.PreRender += this.CurrentForumPage_PreRender; } [/code]

Posted by: tha_watcha - Saturday, 14 April 2012 22:50:41
[quote=youtpout;54181]i found the problem and correct him in source code (the page bug when i have script manager in masterpage) in class PagePopupForumModule [code=csharp] /// /// The init after page. /// public override void InitAfterPage() { if (this._errorPopup == null) AddErrorPopup(); this._errorPopup.Title = this.GetText("COMMON", "MODAL_NOTIFICATION_HEADER"); this.CurrentForumPage.PreRender += this.CurrentForumPage_PreRender; } [/code][/quote] Thanks, this should be fixed now in the repository. Now the Notifcations should work in all cases.

Posted by: archi - Friday, 24 August 2012 01:43:50
Hi I Just downloaded the latest 1.9.6.1 version today and integrated it into my site (an upgrade - i was using 1.9.5.5). But I'm having the same problem as above - if theres a script manager on my master page it won't work. Is there a fix for this? Do I need to be running the source code version to fix it myself? Thanks.

Posted by: daveburke - Friday, 24 August 2012 23:14:35
[quote=archi;56113] if theres a script manager on my master page it won't work. Is there a fix for this? Do I need to be running the source code version to fix it myself? [/quote] The control loads a ScriptManager in OnInit(), so you'll need to fold any ScriptManager services or scripts into it. Hope that helps. -Dave

Posted by: archi - Saturday, 25 August 2012 23:31:01
[quote=daveburke;56119] so you'll need to fold any ScriptManager services or scripts into it. [/quote] Thanks, but I don't know what that means. A little more explanation would be much appreciated.

Posted by: gonso - Tuesday, 4 September 2012 11:55:01
[quote=daveburke;56119] The control loads a ScriptManager in OnInit(), so you'll need to fold any ScriptManager services or scripts into it. Hope that helps. -Dave [/quote] I´m having the same problem with the masterpage scriptmanager due to a telerik control that needs the scriptmanager on the masterpage. Is there a way to avoid YAF:Forum control loading the scriptmanager and make it use the one in the masterpage?

Posted by: tha_watcha - Tuesday, 4 September 2012 13:16:52
[quote=gonso;56245][quote=daveburke;56119] The control loads a ScriptManager in OnInit(), so you'll need to fold any ScriptManager services or scripts into it. Hope that helps. -Dave [/quote] I´m having the same problem with the masterpage scriptmanager due to a telerik control that needs the scriptmanager on the masterpage. Is there a way to avoid YAF:Forum control loading the scriptmanager and make it use the one in the masterpage? [/quote] The only way is to update the code and recompile yaf.

Posted by: gonso - Wednesday, 5 September 2012 21:34:54
Thanks tha_watcha This is what I did taking the advice from tha_watcha: I commented out this lines of code from Forum.cs in the Classes Folder from Yaf inside the OnInit function // handle script manager first... if (ScriptManager.GetCurrent(this.Page) != null) { return; } //// add a script manager since one doesn't exist... var yafScriptManager = new ScriptManager { ID = "YafScriptManager", EnablePartialRendering = true }; this.Controls.Add(yafScriptManager); This avoids Yaf adding a new scriptmanager to the page (as I´m sure I´m adding one in my master page). Recompiled the whole project. Copied all the files in Yaf bin directory into my solution bin directory. And now it seems to work perfectly... I´ll inform if I find any problem.

Posted by: toregua - Wednesday, 19 December 2012 20:54:28
[quote=gonso;56274]Thanks tha_watcha This is what I did taking the advice from tha_watcha: I commented out this lines of code from Forum.cs in the Classes Folder from Yaf inside the OnInit function // handle script manager first... if (ScriptManager.GetCurrent(this.Page) != null) { return; } //// add a script manager since one doesn't exist... var yafScriptManager = new ScriptManager { ID = "YafScriptManager", EnablePartialRendering = true }; this.Controls.Add(yafScriptManager); This avoids Yaf adding a new scriptmanager to the page (as I´m sure I´m adding one in my master page). Recompiled the whole project. Copied all the files in Yaf bin directory into my solution bin directory. And now it seems to work perfectly... I´ll inform if I find any problem.[/quote] Thank you very much :D It works for me too ! You save my day :)