Loading...

All project content is available for reading, but you need to be a member of the project for Subversion checkout of source code, or to create/modify any information.
Login if you are a member. Apply here to request membership (open to all).

Installing the web part framework

How to manually install and configure the web part framework. If you're running EPiServer CMS 5, you can use the download .zip package and EPiServer Manager, which will install the module for you (the .zip package does not contain any source code.)

If you're using EPiServer CMS 4, you need to copy the files manually and configure the site according to the instructions below.

Personalization Store

For EPiServer CMS 4, the ASP.NET Personalization database needs to be created (in CMS 5, it is pre-configured for you).

You need to create the neccessary tables in the sql server database in order to have the web part settings stored. This example assume you create the tables in the EPiServer database.

The following command line script will create the neccessary database tables (membership and personalization)

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql.exe /S <server> /d <database> -A mc -U <username> -P <password>

Or, run the aspnet_regsql.exe with no commands to start a wizard that will take you through the steps.

Note! There is a bug in the installcommon.sql file regarding the length of the Action field. It is set to 20, but on some SQL Server 2005 installations, this is too short. If this fails on your database you can increase the length to 200.

Find the CREATE TABLE #aspnet_Permissions line, and inside that construct find the [Action] varchar(20) line. Change from 20 to 200.

web.config changes and additions

You need to tell the web part manager where to find the personalization data, and where to store the web part data.

<system.web>

  ...

  <webParts>
      <personalization defaultProvider="PageDataPersonalizationProvider">
          <providers>
              <add name="PageDataPersonalizationProvider" 
                   type="EPiCode.WebParts.PageDataPersonalizationProvider"
                   connectionStringName="EPiServerDB" />
          </providers>
          <authorization>
              <allow verbs="enterSharedScope" roles="WebAdmins, WebEditors, Administrators" users="*" />
          </authorization>
      </personalization>
  </webParts>
</system.web>

<connectionStrings>
    <!-- Used for personalization  -->
    <add name="EPiServerDB" connectionString="... The same as EPsConnectionString ..." />
</connectionStrings>

Page Type

Import the package from the PageTypes directory. This will install a new Page Type Web Part Page on your site. This Page Type points to the /templates/webpartpage.aspx template.

Adding the project files

There is no available run-time package for the web part framework for EPiServer CMS 4. You can:

  1. Checkout the code directly from the repository using TortoiseSVN or
  2. Download the source code as a .zip file.

Please note that the Visual Studio project uses a post build event to help you get the files into your main project. Read about the post build event script before you compile the project.

The files copied to the /templates and /templates/webparts directories are self contained (they do not use code behind files) and do not need to be compiled. You can (and probably should) include these in your Visual Studio project.

Testing the framework

  1. Create a new page of the type Web Part Page
  2. Give it a name and publish it
  3. Go to view mode
  4. Right click the page and select Edit Web Parts
  5. You can now add web parts to the page