nj609eagle
2008-09-19T07:10:24Z
I currently have YAF 1.9.3 running in a sub-folder called forums.
The main site is running BLogEngine.NET 1.4.5
This merger was easy. Hoever I want to use the YAF Header and Menu on all pages even thouse outside of the forums folder.
It appears that I have to initalize a YAFContext for the wite so the themes are grabbed properly, but it's not working.
Any help will be appreciated!
Sponsor
test2005
2008-09-19T23:14:13Z
Jaben would be your man for a deffinate answer...but try this..

Dump this into a page and see it it works


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

<YAF:ForumWelcome runat="server" ID="Welcome" />


Obviously, the register tag is at the top, the control tag in the main page.

HTH

:)
.....the man in black fled across the desert..........and the gunslinger followed.....
nj609eagle
2008-09-20T08:14:07Z
Ok, that seems to make a little more sense, however, it's still not working.
Backinng up a step, i'm placing this in my site mater page. It's pathing out to the control without issue.
the error is:


Line 40: 		void ForumWelcome_PreRender( object sender, EventArgs e )
Line 41: 		{
Line 42: 			TimeNow.Text = String.Format( PageContext.Localization.GetText( "Current_Time" ), YafDateTime.FormatTime( DateTime.Now ) );
Line 43: 			TimeLastVisit.Text = String.Format( PageContext.Localization.GetText( "last_visit" ), YafDateTime.FormatDateTime( Mession.LastVisit ) );
Line 44: 
 

Source File: d:\WebSites\BlogEngine\Forums\controls\ForumWelcome.ascx.cs    Line: 42 


It seems like teh PageContext itsn't being set yet.
Is there some way to initalize the YAFContext.Current?
Global.asax file?
test2005
2008-09-20T10:11:10Z
Well, providing you have all the DLL's in the site BIN directory, the control should load!!! So I'm as confused as you are! Outside my knowledge for YAF I'm afraid. Hopefully one of the developers will pop in and point you in the right direction.
.....the man in black fled across the desert..........and the gunslinger followed.....
nj609eagle
2008-09-22T13:48:53Z
I'm using dynamic classes. I copied all of te YAF code into the APP_Code directory under a YAF folder
test2005
2008-09-22T21:31:52Z
nj609eagle wrote:

I'm using dynamic classes. I copied all of te YAF code into the APP_Code directory under a YAF folder



Make sure you have all of the references to ALL your dynamic classes in the web.config file.

IE:



<system.web>
    <pages>
        <controls>
            <add tagPrefix="YAF" namespace="YAF.Classes.UI" />
            <add tagPrefix="YAF" namespace="YAF.Classes.Utils" />
            <add tagPrefix="YAF" namespace="YAF.Classes.Data" />
            <add tagPrefix="YAF" namespace="YAF.Controls" />
            <add tagPrefix="YAF" namespace="YAF.Controls.Statistics" />
            <add tagPrefix="YAF" namespace="YAF.Classes"/>
            <add tagPrefix="YAF" namespace="YAF"/>
            <add tagPrefix="editor" namespace="YAF.Editor"/>
        </controls>
    </pages>
</system.web>




.....the man in black fled across the desert..........and the gunslinger followed.....
nj609eagle
2008-09-23T05:09:44Z
Problem resolved...but a little ugly.
In my site.master page, i added

<YAF:Forum runat="server" ID="masterforum" Visible="false" />
<YAF:Header runat="server" ID="forumheader" />

This did all of the initilizations i needed.
Now I'll create my own header so it will render appropiately and for my BE.NET theme

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