How to integrate BlogEngine into an existing site ?

Topics: ASP.NET 2.0
Jul 1, 2009 at 8:14 AM

hi to all.

i have a site www.viaggiandoinmoto.it developed in aspx/VB#. in this site i have a private section called "WEBMASTER" with authentication trough a login form.

How can i integrate BlogEngine into it ? can i create a sub-folder called "BLOG" and insert into it all files ? and the WEB.CONFIG ? how can i modify it ?

 

Thanks a lot.

 

Riccardo.

Jul 4, 2009 at 7:36 AM

Riccardo,

Yes you can do that, I have done this. I have placed BE in one of the sub folder "Blog". and merged the web.config of the BE with my web application web.config

:Ajay

http://www.ajaymatharu.com

http://twitter.com/matharuajay

Jul 6, 2009 at 9:19 AM

hi matharuajay,

i understand tha i have to merge 2 web.config, but i don't know how. Can u explein better?

in BLOG sub-folder i have to copy BLOGENGINE.CORE and BLOGENGINE.WEB, correct ?

this is my web.config:

 

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<!-- <configuration xmlns="
http://schemas.microsoft.com/.NetConfiguration/v2.0">  -->
<configuration>
 <configSections>
  <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
   <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
     <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
     <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
     <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
     <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections>
 <connectionStrings/>
 <system.web>
  <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.

            Visual Basic options:
            Set strict="true" to disallow all data type conversions
            where data loss can occur.
            Set explicit="true" to force declaration of all variables.
        -->
  <compilation debug="true">
   <assemblies>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
  </compilation>
  <pages>
   <namespaces>
    <clear/>
    <add namespace="System"/>
    <add namespace="System.Collections"/>
    <add namespace="System.Collections.Specialized"/>
    <add namespace="System.Configuration"/>
    <add namespace="System.Text"/>
    <add namespace="System.Text.RegularExpressions"/>
    <add namespace="System.Web"/>
    <add namespace="System.Web.Caching"/>
    <add namespace="System.Web.SessionState"/>
    <add namespace="System.Web.Security"/>
    <add namespace="System.Web.Profile"/>
    <add namespace="System.Web.UI"/>
    <add namespace="System.Web.UI.WebControls"/>
    <!--<add namespace="System.Web.UI.WebControls.WebParts"/>-->
    <add namespace="System.Web.UI.HtmlControls"/>
   </namespaces>
   <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages>
  <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
  <authentication mode="Forms">
   <forms name=".aspxauth_viaggiandoinmoto" loginUrl="webmaster/login.aspx" protection="All" path="/" timeout="3600">
    <credentials passwordFormat="MD5">
     <user name="xzxzxz" password="xzxzxz"/>
    </credentials>
   </forms>
  </authentication>
  <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.
    -->
  <customErrors mode="RemoteOnly" defaultRedirect="errore.aspx">
   <error statusCode="404" redirect="errore.aspx"/>
  </customErrors>
  <httpRuntime maxRequestLength="10000"/>
    
    
   <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpModules>
    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </httpHandlers>
 </system.web>
 <system.codedom>
  <compilers>
   <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="WarnAsError" value="false"/></compiler>
   <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
    <providerOption name="CompilerVersion" value="v3.5"/>
    <providerOption name="OptionInfer" value="true"/>
    <providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom>
 <system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <modules>
   <remove name="ScriptModule"/>
   <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
  <handlers>
   <remove name="WebServiceHandlerFactory-Integrated"/>
   <remove name="ScriptHandlerFactory"/>
   <remove name="ScriptHandlerFactoryAppServices"/>
   <remove name="ScriptResource"/>
   <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
   <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer>
 <runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
   <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
   <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
  </assemblyBinding>
 </runtime>
 <system.net>
  <mailSettings>
   <smtp from="
info@viaggiandoinmoto.it">
    <network host="smtp.viaggiandoinmoto.it" port="25" userName="xxxxx" password="xxxxxx"/>
   </smtp>
  </mailSettings>
 </system.net>
 <appSettings>
  <add key="TO" value="
riccardo@viaggiandoinmoto.it"/>
  <add key="file_viaggi" value="/mdb-database/viaggi.xml"/>
  <add key="file_moto_news" value="/mdb-database/moto.xml"/>
  <add key="file_news" value="/mdb-database/news.xml"/>
  <add key="file_utenti" value="/mdb-database/users.xml"/>
    <add key="file_pagine_visitate" value="/mdb-database/pagine.xml"/>
    <add key="file_mandateci" value="/mdb-database/mandateci.xml"/>
  </appSettings>
 <!--<location path="webmaster">
  <system.web>
   <authorization>
    <deny users="?"/>
   </authorization>
  </system.web>
 </location>-->
 <location path="public/private">
  <system.web>
   <authorization>
    <deny users="?"/>
   </authorization>
  </system.web>
 </location>
</configuration>

how can i modify it ?

 

thanks a lot.

 

Regards.

 

PS: if u want we can chat into SKYPE (botolo79)

Jul 7, 2009 at 8:07 AM
Edited Jul 7, 2009 at 8:10 AM

Hi I have just posted a blog on merging the BE web.config with you web application web.config, here is the link to that,

http://www.ajaymatharu.com/2009/07/07/integrating-blogengine-into-an-existing-site/

you have to copy files only from BlogEngine.web and not from BlogEngine.core into your web applications blogs folder and make these changes to web.config files.

Let me know if you need any more assistance.

You can add me on skype my skype id is (ajay.matharu)

 

Jul 9, 2009 at 8:52 AM

Ajay,

after some other things doen together, the blog seems to work. But i still have a problem. When i try to login as Administrator, the system said "Role Function is not enabled". How it's possible ?

Thanks a lot.

 

Regards.