Welcome Guest, you are in: Login

Yet Another Forum.NET Documention

RSS RSS

Navigation





Search the wiki
»

PoweredBy
Under
<configSections>
Add
<section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, 
Intelligencia.UrlRewriter" requirePermission="false"/>
My application settings were already separate from my web.config so I added all the sections from app.config to my application configuration file called xsettings.config in this example

<appSettings file="XSettings.config">
</appSettings>
Just below that comes a reference to the url rewriter configuration (make sure to move this file to your root directory)

<rewriter configSource="URLRewriter.config" />
Next under connection strings add a reference to the “yafnet” you can either use the yaf approach and use an external file or my approach and keep the connection strings in the web.config. If you are like me you’ll need two connection strings, one for your current database with your membership info and one for yaf. You can do everything in one and if you are already using a profile provider you'll need to use one, if not then you might as well take advantage of using two.

<add name="yafnet" connectionString="Server=MyServer;Database=Yafdb;UID=bogger;PWD=password;" />
Next we’ll move to roles, membership and profile providers. I use the sql providers that come shipped with asp.net 2.0. You’ll need to make sure you have all three in your web.config and the profile provider has to be yaf’s. More here So change it to something like this:

<profile enabled="true" defaultProvider="YafProfileProvider" 
inherits="YAF.Classes.Utils.YafUserProfile">
 <providers>
   <clear/>
 <add connectionStringName="yafnet" applicationName="Your Application Name" 
name="YafProfileProvider" type="YAF.Providers.Profile.YafProfileProvider"/>
  </providers>
 <properties>
   <add name="Theme" allowAnonymous="false" defaultValue="Blue"/>
 </properties>
</profile>
Next we move on to the compilation section (if you don’t have it add it) You will need to have added moved the yaf app_code\YAF folder under your app_code folder If you’re site is VB.Net then you’ll definitely need this section as Yaf is C#, otherwise it’s optional; this just tells the compiler to treat this directory separately.

<codeSubDirectories>
    <add directoryName="YAF" />
</codeSubDirectories>
Next up, HttpModules, we need more references add these

<add name="YafInitModule" type="YAF.Classes.Base.YafInitModule, YAF.Classes.Base"/>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter"/>
Next comes Pages and controls add these. I copied these line for line using the non dynamic method because I moved the dlls into my bin directory, I recommend this.

<pages validateRequest="false" smartNavigation="false">
             <controls>
                 <add tagPrefix="asp" namespace="System.Web.UI" 
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
                 <add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
                 <!-- Default: use non-dynamic (compiled classes) in YAF -->
                 <add tagPrefix="YAF" namespace="YAF.Classes.UI" assembly="YAF.Classes.UI"/>
                 <add tagPrefix="YAF" namespace="YAF.Classes.Utils" 
assembly="YAF.Classes.Utils"/>
                 <add tagPrefix="YAF" namespace="YAF.Classes.Data" 
assembly="YAF.Classes.Data"/>
                 <add tagPrefix="YAF" namespace="YAF.Controls" assembly="YAF.Controls"/>
                 <add tagPrefix="YAF" namespace="YAF.Controls.Statistics" assembly="YAF.Controls"/>
                 <!-- Optional: use dynamic classes in YAF by moving all the YAF.x directories 
(YAF.Classes.*, YAF.Providers)
                         into the App_Code\YAF directory. Delete the associated .dll files from the \bin directory. Comment out the above 
                         "non-dynamic" namespaces above and enable these: 
                 -->
                 <!--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>
             <namespaces>
                 <add namespace="YAF"/>
                 <add namespace="YAF.Classes.UI"/>
                 <add namespace="YAF.Classes.Utils"/>
                 <add namespace="YAF.Controls"/>
                 <add namespace="YAF.Classes.Data"/>
             </namespaces>
         </pages>
Under system.webserver (if you don’t have it add it <system.webServer> </system.webServer>)

we add more modules

If you don’t have the <modules> </modules>section add it before and after.

<add name="YafInitModule" type="YAF.Classes.Base.YafInitModule, YAF.Classes.Base"/>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" 
preCondition="managedHandler"/>
Finally make sure you either add a reference to the mail.config
<system.net>
  <mailSettings>
   <smtp configSource="mail.config"/>
  </mailSettings>
</system.net>
or add your settings as such

<system.net>
        <mailSettings>
            <smtp from="myemail@email.net">
                <network host="smtp.email.net" password="gostuff" userName="myemail"/>
            </smtp>
        </mailSettings>
</system.net>

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.