<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title type="text">Blogs</title>
    <link href="http://world.episerver.com" />
    <updated>2013-05-17T14:18:00.0000000Z</updated>
    <id>http://world.episerver.com/Blogs/</id>
    <generator uri="http://world.episerver.com" version="2.0">EPiServer World</generator>
    <entry>
        <title>DropDownList Category Picker in EPiServer 7</title>
        <link href="http://krompaco.nu/2013/05/dropdownlist-category-picker-in-episerver-7/" />
        <id>http://krompaco.nu/2013/05/dropdownlist-category-picker-in-episerver-7/</id>
        <updated>2013-05-17T14:18:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;A client needed the editors to be able to select one category from a SELECT box. I knew there were some built-in controls to make things like this easy in EPiServer 7.&lt;/p&gt;&lt;p&gt;Looking around these two posts helped me to find what I think is the best way:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2012/9/EPiServer-7-Configuring-editors-for-your-properties/&quot;&gt;EPiServer 7: Configuring editors for your properties by Linus Ekstr&#246;m&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://joelabrahamsson.com/limiting-content-and-page-reference-properties-to-values-of-a-specific-type-in-episerver-cms/&quot;&gt;A filtered page reference property by Joel Abrahamsson&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my case I needed the children and grandchildren of a configured root category as possible items.&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
namespace Krompaco.Project.Site
{
    using System.Collections.Generic;
    using EPiServer.DataAbstraction;
    using EPiServer.Shell.ObjectEditing;

    public class CategorySelectionFactory : ISelectionFactory
    {
        public IEnumerable GetSelections(ExtendedMetadata metadata)
        {
            var list = new List&amp;lt;SelectItem&amp;gt;();
            var root = Category.Find(yourIdInteger);

            foreach (Category country in root.Categories)
            {
                list.Add(new SelectItem
                  {
                     Text = country.LocalizedDescription.ToUpper(),
                     Value = country.ID.ToString()
                  });

                foreach (Category region in country.Categories)
                {
                    list.Add(new SelectItem
                      {
                        Text = region.LocalizedDescription,
                        Value = region.ID.ToString()
                      });
                }
            }

            return list;
        }
    }
}
&lt;/pre&gt;

&lt;p&gt;Then you need to do this to make the UIHint mean something. Seems like there are problems having an &lt;em&gt;int&lt;/em&gt; TargetType but I can live with having the property stored as a string.&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
namespace Krompaco.Project.Site
{
    using System;
    using System.Collections.Generic;
    using EPiServer.Shell.ObjectEditing;
    using EPiServer.Shell.ObjectEditing.EditorDescriptors;

    [EditorDescriptorRegistration(
        TargetType = typeof(string),
        UIHint = &quot;project-category-select&quot;)]
    public class CategorySelector : EditorDescriptor
    {
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
        {
            SelectionFactoryType = typeof(CategorySelectionFactory);
            
            // If on 7.0 and not 7.1 this has a slightly different syntax (more dots)
            ClientEditingClass = &quot;epi-cms/contentediting/editors/SelectionEditor&quot;;

            base.ModifyMetadata(metadata, attributes);
        }
    }
}
&lt;/pre&gt;

&lt;p&gt;Then just decorate properties with the same UIHint like this:&lt;/p&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;
[UIHint(&quot;project-category-select&quot;)]
[Display(
  Name = &quot;Primary category&quot;,
  GroupName = SystemTabNames.Content,
  Order = 900)]
public virtual string PrimaryCategoryId { get; set; }
&lt;/pre&gt;

&lt;p&gt;In Edit Mode you&#39;ll then get a sleek DropDownList like this.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;fullwidth-dec&quot; src=&quot;http://krompaco.nu/pagefiles/530/screenshot.png&quot; width=&quot;343&quot; height=&quot;192&quot; alt=&quot;Screenshot of Edit Mode&quot; /&gt;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Unsupported languages: Arabic, Tigrinya or Chinese characters in SiteSeeker search result using EPiServer</title>
        <link href="http://blog.mathiaskunto.com/?p=2480" />
        <id>http://blog.mathiaskunto.com/?p=2480</id>
        <updated>2013-05-16T19:38:09.0000000Z</updated>
        <summary type="html">The latest version of the SiteSeeker search engine supports indexing and searching in a variety of different languages; however, languages that are not using the latin alphabet, for instance arabic, hebrew, japanese as well as chinese, cannot be indexed. If &amp;#8230; &lt;a href=&quot;http://blog.mathiaskunto.com/2013/05/16/unsupported-languages-arabic-tigrinya-or-chinese-characters-in-siteseeker-search-result-using-episerver/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</summary>
    </entry>    <entry>
        <title>Texts missing inTinyMCE?</title>
        <link href="http://world.episerver.com/Blogs/Jonas-Lindau/Dates/2013/5/Texts-missing-inTinyMCE/" />
        <id>http://world.episerver.com/Blogs/Jonas-Lindau/Dates/2013/5/Texts-missing-inTinyMCE/</id>
        <updated>2013-05-16T11:37:48.0000000Z</updated>
        <summary type="html">&lt;p&gt;If all captions and tooltips are missing in tinyMCE, there’s good chance you are using themed CSS. Over the years I’ve learned that EPiServer make some assumptions, that not always applies to your reality. &lt;img style=&quot;border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none&quot; class=&quot;wlEmoticon wlEmoticon-smile&quot; alt=&quot;Smile&quot; src=&quot;/Globals/xmlrpc/30201/2013/05/16/wlEmoticon-smile_2.png&quot; /&gt; One of them is that it’s assumed your not using themed CSS on your site. There has been some minor issues with themed CSS over the years, and a new one seems to apply to tinyMCE.&lt;/p&gt;  &lt;p&gt;When I first configured the site to use tinyMCE, it looked like this:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/30201/2013/05/16/Untitled_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;Untitled&quot; border=&quot;0&quot; alt=&quot;Untitled&quot; src=&quot;/Globals/xmlrpc/30201/2013/05/16/Untitled_thumb.png&quot; width=&quot;650&quot; height=&quot;319&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Firebug to the rescue! Error 500 when loading TinyMCEi18n.aspx can&#228;tbe good, so whats the reason?&lt;/p&gt; &lt;a href=&quot;/Globals/xmlrpc/30201/2013/05/16/Capture.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;Capture&quot; border=&quot;0&quot; alt=&quot;Capture&quot; src=&quot;/Globals/xmlrpc/30201/2013/05/16/Capture_thumb.png&quot; width=&quot;937&quot; height=&quot;191&quot; /&gt;&lt;/a&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So how to solve this?&lt;/p&gt;  &lt;p&gt;Well, you could edit the aspx-page and turn of theming, but chances are you apply a hot fix or service pack that overwrites your custom changes. I thought a better way was to turn theming off for that specific location using web.config. Since the file resides in /util/, you can solve this by editing the &amp;lt;location path=&amp;quot;util&amp;quot;&amp;gt;-section as below:&lt;/p&gt;  &lt;p&gt;&amp;lt;location path=&amp;quot;util&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;system.web&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&amp;lt;pages theme=&amp;quot;&amp;quot;&amp;gt;&lt;/strong&gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/pages&amp;gt;     &lt;br /&gt;&amp;#160; &amp;lt;system.web&amp;gt;     &lt;br /&gt;&amp;lt;location&amp;gt;&lt;/p&gt;  &lt;p&gt;Save the file, and then tinyMCE should look great!&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Using the REST API of ImageVault</title>
        <link href="http://dhvik.blogspot.com/2013/05/using-rest-api-of-imagevault.html" />
        <id>http://dhvik.blogspot.com/2013/05/using-rest-api-of-imagevault.html</id>
        <updated>2013-05-16T09:32:00.0000000Z</updated>
        <summary type="html">In ImageVault 4 we introduced a REST API for the ImageVault Core service. This will show a small example on how to use that.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Javascript&lt;/h3&gt;&lt;div&gt;This example uses javascript and the javascript classes that are included in the ImageVault installation (in the UI). I will use the scripts that are located on the beta installation but you can use the ones that are on your installation as well.&lt;/div&gt;&lt;div&gt;We need three scripts, jquery, json2 and ImageVault.Client. ImageVault.Client handles authentication and CORS logic for the app.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;script&amp;nbsp;type=&quot;text/javascript&quot; src=&quot;https://imagevault.se/beta/ImageVault/Scripts/lib/jquery-1.6.1.js&quot; &amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;https://imagevault.se/beta/ImageVault/Scripts/lib/json2.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;https://imagevault.se/beta/ImageVault/Scripts/ImageVault.Client.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Client&lt;/h3&gt;&lt;div&gt;To connect to core we need the javascript client.&lt;/div&gt;&lt;pre&gt;var core = new ImageVault.Client({&lt;br /&gt; authUrl: &quot;https://imagevault.se/beta/ImageVaultIdp/http.issue&quot;,&lt;br /&gt; realm: &quot;https://imagevault.se:1234&quot;,&lt;br /&gt; username: &quot;demouser&quot;,&lt;br /&gt; password: &quot;P@55w0rd!&quot;&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;The core client is created using the following parameters &lt;/div&gt;&lt;dl&gt;&lt;dt&gt;authUrl&lt;/dt&gt;&lt;dd&gt;This is the url to the Idp endpoint that can issue a ticket to be used with the core calls. Authentication uses federated authentication&lt;/dd&gt;&lt;dt&gt;realm&lt;/dt&gt;&lt;dd&gt;This is the url to core and also instructs the Idp on who the recipient of the ticket is.&lt;/dd&gt;&lt;dt&gt;username/password&lt;/dt&gt;&lt;dd&gt;the username and password of the user.&lt;/dd&gt;&lt;/dl&gt;&lt;h3&gt;Authentication&lt;/h3&gt;&lt;div&gt;We use federated authentication and to be able to call the services you need to have an authentication ticket. To get the ticket you need to authenticate vs the IdentityProvider (Idp). This is handled by the ImageVault.Client script. Also reissuing of tickets when they exipire are handled by the client script.&lt;/div&gt;&lt;h3&gt;API calls to Core&lt;/h3&gt;&lt;div&gt;To call the REST API we use the json method of the client that performs an authenticated call to the core.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;core.json(&quot;MediaService/Find&quot;, {&lt;br /&gt;  Filter: { SearchString: searchString },&lt;br /&gt;  Populate: {&lt;br /&gt;    MediaFormats: [&lt;br /&gt;      //Thumbnail format&lt;br /&gt;      {  &lt;br /&gt;        $type: &quot;ImageVault.Common.Data.ThumbnailFormat,ImageVault.Common&quot;, &lt;br /&gt;        Effects:[&lt;br /&gt;          {$type:&quot;ImageVault.Common.Data.Effects.ResizeEffect, ImageVault.Common&quot;,Width:200,Height:200,ResizeMode:&#39;ScaleToFill&#39;}&lt;br /&gt;        ]&lt;br /&gt;      }&lt;br /&gt;    ]&lt;br /&gt;  }    &lt;br /&gt;}, function (d) {&lt;br /&gt;  alert(JSON.stringify(d));&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;div&gt;The json call uses the following parameters&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;path&lt;/dt&gt;&lt;dd&gt;The service/method to call. Name of the service is the same as the interface (omit the leading I)&lt;/dd&gt;&lt;dt&gt;arguments&lt;/dt&gt;&lt;dd&gt;the arguments to the service method as a javascript object. If the method takes multiple arguments, wrap them in a single object (.e {arg1:&#39;test&#39;,arg2:&#39;test2&#39;} )&lt;/dd&gt;&lt;dt&gt;success callback&lt;/dt&gt;&lt;dd&gt;The function to call when the service call is done. The argument to the function is the return value of the service method.&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;&lt;div&gt;The services are documented&amp;nbsp;&lt;a href=&quot;http://imagevault.se/DeveloperDocumentation/Reference/html/N_ImageVault_Common_Services.htm&quot; target=&quot;_blank&quot;&gt;at the ImageVault API reference documentation&lt;/a&gt;. The full ImageVault developer documentation can be found at&amp;nbsp;&lt;a href=&quot;http://imagevault.se/doc&quot; target=&quot;_blank&quot;&gt;http://imagevault.se/doc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can test a fully fledged demo below that uses the ImageVault demo site scripts and content that performs a search and displays the thumbnail media&lt;/div&gt;&lt;!--DEMO starts here--&gt;&lt;script src=&quot;https://imagevault.se/beta/ImageVault/Scripts/lib/jquery-1.6.1.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;script src=&quot;https://imagevault.se/beta/ImageVault/Scripts/lib/json2.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;script src=&quot;https://imagevault.se/beta/ImageVault/Scripts/ImageVault.Client.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;$(document).ready(function () {   var core = new ImageVault.Client({     authUrl: &quot;https://imagevault.se/beta/ImageVaultIdp/http.issue&quot;,     realm: &quot;https://imagevault.se:1234&quot;,     username: &quot;demouser&quot;,     password: &quot;P@55w0rd!&quot;   });   //trigger enter on search form   $(&quot;#coreSearchString&quot;).keyup(function(event){     if(event.keyCode == 13){       $(&quot;#coreSearch&quot;).click();     }   });   $(&quot;#coreSearch&quot;).click(function () {     var searchString = $(&quot;#coreSearchString&quot;).val();     $(&quot;#searchResultInfo&quot;).text(&quot;searching for &quot; + searchString);     $(&quot;#searchResult&quot;).text(&quot;&quot;);     core.json(&quot;MediaService/Find&quot;, {       Filter: { SearchString: searchString },       Populate: {         MediaFormats: [           //Thumbnail format           {               $type: &quot;ImageVault.Common.Data.ThumbnailFormat,ImageVault.Common&quot;,              Effects:[{$type:&quot;ImageVault.Common.Data.Effects.ResizeEffect, ImageVault.Common&quot;,Width:200,Height:200,ResizeMode:&#39;ScaleToFill&#39;}]           }         ]       }         }, function (d) {       $(&quot;#searchResultInfo&quot;).text(&quot;Found &quot; + d.length + &quot; hits.&quot;);       for (var i = 0; i &lt; d.length; i++) {         var item = d[i];         var thumbnail = item.MediaConversions[0];         $(&quot;#searchResult&quot;).append(&quot;&lt;div style=&#39;float:left;text-align:center;&#39;&gt;&lt;img src=&#39;&quot; + thumbnail.Url + &quot;&#39;/&gt;&lt;br/&gt;&quot;+item.Name+&quot;&lt;/div&gt;&quot;);       }     });   }); }); &lt;/script&gt;&lt;br /&gt;&lt;h1&gt;Demo&lt;/h1&gt;&lt;input id=&quot;coreSearchString&quot; type=&quot;text&quot; value=&quot;P1&quot; /&gt;  &lt;button id=&quot;coreSearch&quot;&gt;Search media&lt;/button&gt;  &lt;br /&gt;</summary>
    </entry>    <entry>
        <title>5 years of EPiServer World awesomeness</title>
        <link href="http://www.epinova.no/blog/arild-henrichsen/dates/2013/5/5-years-of-episerver-world-awesomeness/" />
        <id>http://www.epinova.no/blog/arild-henrichsen/dates/2013/5/5-years-of-episerver-world-awesomeness/</id>
        <updated>2013-05-10T12:54:34.0000000Z</updated>
        <summary type="html">Celebrating its 5th online anniversary by passing 19000 members, EPiServer World continues to be a hub of great resources for developers, site owners and marketers.</summary>
    </entry>    <entry>
        <title>Adding Cross Site Scripting protection in EPiServer CMS with .NET 4.0</title>
        <link href="http://www.epinova.no/blog/Kjetil-Simensen/dates/2013/5/adding-cross-site-scripting-protection-in-episerver-cms-with-net-40/" />
        <id>http://www.epinova.no/blog/Kjetil-Simensen/dates/2013/5/adding-cross-site-scripting-protection-in-episerver-cms-with-net-40/</id>
        <updated>2013-05-10T06:31:22.0000000Z</updated>
        <summary type="html">The built-in Request Validation feature in .NET 4.0 can help protect your EPiServer sites from Cross Site Scripting (XSS) attacks.</summary>
    </entry>    <entry>
        <title>Render ContentArea with temporarily content</title>
        <link href="http://world.episerver.com/Blogs/Anders-Hattestad/Dates/2013/5/Render-ContentArea-with-temporarily-content/" />
        <id>http://world.episerver.com/Blogs/Anders-Hattestad/Dates/2013/5/Render-ContentArea-with-temporarily-content/</id>
        <updated>2013-05-08T07:16:31.0000000Z</updated>
        <summary type="html">&lt;p&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;One nice feature in EPiServer 7 is the ability to render content based on tags and type.&amp;nbsp; But sometimes you want to add temporary items to a collection and then render them. This can be a RSS feed, or if you want to add one link list with and existing ContentArea.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;The problem is that temporary items will not be rendered thru the PropertyContentAreaControl. So if you add some temporarily items like some RSS articles it will not render.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;You can add IContent to a ContentArea, but internally it is stored as content reference, and the object is not preserved. It basically add the content Reference ID, and then when you render it it gets the content again. That means you cant manipulate the IContent items before you render them. Personally I think this behaviour is a bit odd, and makes it a bit harder to do cool stuff &lt;img class=&quot;wlEmoticon wlEmoticon-smile&quot; style=&quot;border-style: none;&quot; src=&quot;/Globals/xmlrpc/25266/2013/05/08/wlEmoticon-smile_2.png&quot; alt=&quot;Smilefjes&quot; /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;Create temporarily content&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color: #000000;&quot;&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;&lt;span&gt;Before it was possible to create pages and add them to a page list. You had to add the ACL to the page so it was not filtered out.&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:84d019f2-44f5-4e0d-8b6e-4bc669981e6b&quot; class=&quot;wlWriterEditableSmartContent&quot; style=&quot;float: none; margin: 0px; display: inline; padding: 0px;&quot;&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 10pt;&quot;&gt;
&lt;div style=&quot;font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;&quot;&gt;Code Snippet&lt;/div&gt;
&lt;div style=&quot;background: #fff; max-height: 300px; overflow: auto;&quot;&gt;&lt;ol style=&quot;background: #ffffff; margin: 0; padding: 0 0 0 5px; white-space: nowrap;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;var&lt;/span&gt; page = &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;TempPageType&lt;/span&gt;();&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;page.Property.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;PageTypeID&quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyNumber&lt;/span&gt;(pageID));&lt;/li&gt;
&lt;li&gt;page.Property.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;PageLink&quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyPageReference&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;PageReference&lt;/span&gt;.EmptyReference));&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;page.Property.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;PagePendingPublish&quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyBoolean&lt;/span&gt;(&lt;span style=&quot;color: #0000ff;&quot;&gt;false&lt;/span&gt;));&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;page.Property.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;PageWorkStatus&quot;&lt;/span&gt;,&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyNumber&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;Convert&lt;/span&gt;.ToInt32(&lt;span style=&quot;color: #2b91af;&quot;&gt;VersionStatus&lt;/span&gt;.Published)));&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;page.ACL.Add(&lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;AccessControlEntry&lt;/span&gt;(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Everyone&quot;&lt;/span&gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;AccessLevel&lt;/span&gt;.Read));&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff; color: #000000;&quot;&gt;In EPiServer 7 you have to register this page type and also add the PageTypeID to the temporarily page&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:5a728c0b-8ea0-4c8b-9109-eb058b245005&quot; class=&quot;wlWriterEditableSmartContent&quot; style=&quot;float: none; margin: 0px; display: inline; padding: 0px;&quot;&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 10pt;&quot;&gt;
&lt;div style=&quot;font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;&quot;&gt;Code Snippet&lt;/div&gt;
&lt;div style=&quot;background: #ddd; max-height: 300px; overflow: auto;&quot;&gt;&lt;ol style=&quot;background: #ffffff; margin: 0 0 0 2em; padding: 0 0 0 5px;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;var&lt;/span&gt; repository = &lt;span style=&quot;color: #2b91af;&quot;&gt;ServiceLocator&lt;/span&gt;.Current.GetInstance&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;IContentTypeRepository&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;PageType&lt;/span&gt;&amp;gt;&amp;gt;();&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;var&lt;/span&gt; pageType = repository.Load(&lt;span style=&quot;color: #0000ff;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;TempPageType&lt;/span&gt;));&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;var&lt;/span&gt; pageID=-1;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (pageType!=&lt;span style=&quot;color: #0000ff;&quot;&gt;null&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pageID=pageType.ID;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;page.Property.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;PageTypeID&quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;PropertyNumber&lt;/span&gt;(pageID));&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;And then register the page type.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div id=&quot;scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:efffc6fd-d239-4864-997a-44549870adab&quot; class=&quot;wlWriterEditableSmartContent&quot; style=&quot;float: none; margin: 0px; display: inline; padding: 0px;&quot;&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 10pt;&quot;&gt;
&lt;div style=&quot;font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;&quot;&gt;Code Snippet&lt;/div&gt;
&lt;div style=&quot;background: #fff; max-height: 300px; overflow: auto;&quot;&gt;&lt;ol style=&quot;background: #ffffff; margin: 0; padding: 0 0 0 5px; white-space: nowrap;&quot;&gt;
&lt;li&gt;[&lt;span style=&quot;color: #2b91af;&quot;&gt;ContentType&lt;/span&gt;(GUID = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;454E47D6-BC76-4596-BC03-8BA519BB4650&quot;&lt;/span&gt;, GroupName = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Default&quot;&lt;/span&gt;,AvailableInEditMode=&lt;span style=&quot;color: #0000ff;&quot;&gt;false&lt;/span&gt;)]&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;TempPageType&lt;/span&gt; : &lt;span style=&quot;color: #2b91af;&quot;&gt;SitePageData&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[&lt;span style=&quot;color: #2b91af;&quot;&gt;Ignore&lt;/span&gt;]&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;object&lt;/span&gt; InnerObject { &lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;; }&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;override&lt;/span&gt; EPiServer.Security.&lt;span style=&quot;color: #2b91af;&quot;&gt;ISecurityDescriptor&lt;/span&gt; GetSecurityDescriptor()&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;PageReference&lt;/span&gt;.IsNullOrEmpty(PageLink))&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;OwnSecurityDescriptor&lt;/span&gt;();&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;base&lt;/span&gt;.GetSecurityDescriptor();&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;OwnSecurityDescriptor&lt;/span&gt;:&lt;span style=&quot;color: #2b91af;&quot;&gt;ISecurityDescriptor&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;AccessLevel&lt;/span&gt; GetAccessLevel(&lt;span style=&quot;color: #2b91af;&quot;&gt;IPrincipal&lt;/span&gt; principal)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;AccessLevel&lt;/span&gt;.FullAccess;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt; HasAccess(&lt;span style=&quot;color: #2b91af;&quot;&gt;IPrincipal&lt;/span&gt; principal, &lt;span style=&quot;color: #2b91af;&quot;&gt;AccessLevel&lt;/span&gt; access)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;true&lt;/span&gt;;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;}&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;To render&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;The solution is to make your own render of a List of IContent&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;Lucky for us it’s still easy to look at the current code using Reflector or some other app. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;This code will take a list of IContent and render them accordingly to the tags. So you can use it like this, where Result is a List&amp;lt;IContent&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:ff25dbbc-3654-4779-b4dc-4a3136f278cf&quot; class=&quot;wlWriterEditableSmartContent&quot; style=&quot;float: none; margin: 0px; display: inline; padding: 0px;&quot;&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 10pt;&quot;&gt;
&lt;div style=&quot;font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;&quot;&gt;Code Snippet&lt;/div&gt;
&lt;div style=&quot;background: #fff; max-height: 300px; overflow: auto;&quot;&gt;&lt;ol style=&quot;background: #ffffff; margin: 0; padding: 0 0 0 5px; white-space: nowrap;&quot;&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt; AddResult2Container(&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt; container,&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; tag, &lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt; add_Ul_Li)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;var&lt;/span&gt; haveContent = &lt;span style=&quot;color: #0000ff;&quot;&gt;false&lt;/span&gt;;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;var&lt;/span&gt; result = &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;RenderContentArea&lt;/span&gt;() { Data = Result };&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result.Tag = tag;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (add_Ul_Li)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result.TagName = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;ul&quot;&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result.TagChildName = &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;li&quot;&lt;/span&gt;;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;container.Controls.Add(result);&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;haveContent = result.CreateContent();&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; haveContent;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;}&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style=&quot;background-color: #ffffff;&quot;&gt;The code that runs is this&lt;/span&gt;&lt;/p&gt;
&lt;div id=&quot;scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:8e27801d-557c-4a9a-894e-9ca18dc1a16c&quot; class=&quot;wlWriterEditableSmartContent&quot; style=&quot;float: none; margin: 0px; display: inline; padding: 0px;&quot;&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, Monospace; font-size: 10pt;&quot;&gt;
&lt;div style=&quot;font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px;&quot;&gt;Code Snippet&lt;/div&gt;
&lt;div style=&quot;background: #ddd; max-height: 300px; overflow: auto;&quot;&gt;&lt;ol style=&quot;background: #ffffff; margin: 0 0 0 3em; padding: 0 0 0 5px; white-space: nowrap;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;RenderContentArea&lt;/span&gt; : &lt;span style=&quot;color: #2b91af;&quot;&gt;PlaceHolder&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;IContent&lt;/span&gt;&amp;gt; Data { &lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;; }&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; TagName { &lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; TagChildName { &lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;; }&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; ItemCssClass { &lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;; }&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; ItemChildCssClass { &lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; Tag { &lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;; &lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;; }&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ContentControlResolver&lt;/span&gt; _contentControlResolver;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ContentControlResolver&lt;/span&gt; ContentControlResolver&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ContentControlResolver&lt;/span&gt; arg_1D_0;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; ((arg_1D_0 = &lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;._contentControlResolver) == &lt;span style=&quot;color: #0000ff;&quot;&gt;null&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arg_1D_0 = (&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;._contentControlResolver = &lt;span style=&quot;color: #2b91af;&quot;&gt;ServiceLocator&lt;/span&gt;.Current.GetInstance&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;ContentControlResolver&lt;/span&gt;&amp;gt;());&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; arg_1D_0;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;._contentControlResolver = &lt;span style=&quot;color: #0000ff;&quot;&gt;value&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;IList&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt;&amp;gt; GetContentRenderers2()&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (Data == &lt;span style=&quot;color: #0000ff;&quot;&gt;null&lt;/span&gt; || Data.Count&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;IContent&lt;/span&gt;&amp;gt;() == 0)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt;&amp;gt;();&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; itemTagName = TagChildName;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; itemCssClass = ItemChildCssClass;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; ResolveContentControls(&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;.Tag, itemCssClass, itemTagName);&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Injected&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;TemplateControlLoader&lt;/span&gt;&amp;gt; TemplateControlLoader&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;WebFormsContentValidator&lt;/span&gt; _contentValidator;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;WebFormsContentValidator&lt;/span&gt; ContentValidator&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;get&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;WebFormsContentValidator&lt;/span&gt; arg_1D_0;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; ((arg_1D_0 = &lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;._contentValidator) == &lt;span style=&quot;color: #0000ff;&quot;&gt;null&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arg_1D_0 = (&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;._contentValidator = &lt;span style=&quot;color: #2b91af;&quot;&gt;ServiceLocator&lt;/span&gt;.Current.GetInstance&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;WebFormsContentValidator&lt;/span&gt;&amp;gt;());&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; arg_1D_0;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;set&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;._contentValidator = &lt;span style=&quot;color: #0000ff;&quot;&gt;value&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;IList&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt;&amp;gt; ResolveContentControls( &lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt; parentControl, &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; tag, &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; itemCssClass, &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; itemTagName)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;IContentFilter&lt;/span&gt; filter = &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;FilterContentForVisitor&lt;/span&gt;(&lt;span style=&quot;color: #2b91af;&quot;&gt;TemplateTypeCategories&lt;/span&gt;.WebFormsPartial, tag);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt;&amp;gt; list = &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt;&amp;gt;();&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;IContent&lt;/span&gt;&amp;gt; source = Data;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;IContent&lt;/span&gt;&amp;gt; enumerable =&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;from&lt;/span&gt; c &lt;span style=&quot;color: #0000ff;&quot;&gt;in&lt;/span&gt; source&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;where&lt;/span&gt;&amp;nbsp;&amp;nbsp;!filter.ShouldFilter(c)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;select&lt;/span&gt; c;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;IContent&lt;/span&gt; current &lt;span style=&quot;color: #0000ff;&quot;&gt;in&lt;/span&gt; enumerable)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt; control = &lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;.TemplateControlLoader.Service.LoadControl(&lt;span style=&quot;color: #2b91af;&quot;&gt;HttpContext&lt;/span&gt;.Current.ContextBaseOrNull(), current, parentControl.TemplateControl, tag);&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;.ContentValidator.ExistInControlHierarchy(parentControl, current, control))&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//if (enableEditFeatures)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//{&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HtmlGenericControl item = this.BuildCircularReferenceControl(current, itemTagName, itemCssClass);&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.Add(item);&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;else&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;IVersionable&lt;/span&gt; versionable = current &lt;span style=&quot;color: #0000ff;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;IVersionable&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (versionable == &lt;span style=&quot;color: #0000ff;&quot;&gt;null&lt;/span&gt; || versionable.Status == &lt;span style=&quot;color: #2b91af;&quot;&gt;VersionStatus&lt;/span&gt;.Published)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ContentRenderer&lt;/span&gt; item2 = &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ContentRenderer&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CurrentControl = control,&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CurrentData = current,&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CurrentContent = current,&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Tag = tag,&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CustomTagName = itemTagName,&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CssClass = itemCssClass,&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TemplateControlLoader = &lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;.TemplateControlLoader,&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RenderType =&lt;span style=&quot;color: #2b91af;&quot;&gt;RenderType&lt;/span&gt;.Default&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;list.Add(item2);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; list;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt; CreateContent()&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; containerTagName = (!&lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(TagName)) ? TagName : &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;div&quot;&lt;/span&gt;;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Collections.Generic.&lt;span style=&quot;color: #2b91af;&quot;&gt;IList&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt;&amp;gt; contentRenderers = &lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;.GetContentRenderers2();&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt; control = CreateMainContainer(containerTagName);&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt; current &lt;span style=&quot;color: #0000ff;&quot;&gt;in&lt;/span&gt; contentRenderers)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;control.Controls.Add(current);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;ContentRenderer&lt;/span&gt; contentRenderer = current &lt;span style=&quot;color: #0000ff;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ContentRenderer&lt;/span&gt;;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (contentRenderer != &lt;span style=&quot;color: #0000ff;&quot;&gt;null&lt;/span&gt;)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;contentRenderer.EnsureChildControlsCreated();&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (contentRenderers.Count &amp;gt; 0)&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;true&lt;/span&gt;;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;false&lt;/span&gt;;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;HtmlGenericControl&lt;/span&gt; CreateMainContainer( &lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt; containerTagName)&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;HtmlGenericControl&lt;/span&gt; htmlGenericControl = &lt;span style=&quot;color: #0000ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;HtmlGenericControl&lt;/span&gt;(containerTagName);&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;.Controls.Add(htmlGenericControl);&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//if (enableEditFeatures)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//{&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.ApplyEditAttributes();&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #008000;&quot;&gt;//}&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; htmlGenericControl;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;background: #f3f3f3;&quot;&gt;}&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</summary>
    </entry>    <entry>
        <title>EPiServer 7: Strongly typed page types in FPWC</title>
        <link href="http://world.episerver.com/Blogs/Dan-Matthews/Dates/2013/5/EPiServer-7-Strongly-typed-page-types-in-FPWC/" />
        <id>http://world.episerver.com/Blogs/Dan-Matthews/Dates/2013/5/EPiServer-7-Strongly-typed-page-types-in-FPWC/</id>
        <updated>2013-05-07T13:48:59.0000000Z</updated>
        <summary type="html">&lt;p&gt;No, not really :) FindPagesWithCriteria (FPWC) is still the same beast it always was. For those of us who used PageTypeBuilder a lot, you will have worked with the page type resolver that allowed us to – at the very least – turn a strongly typed page type into a page type ID and feed it into FPWC.&lt;/p&gt;  &lt;p&gt;EPiServer 7 provider the same feature as well. For example, let’s say we have a method to get all children of type ‘StandardPage’. We use the content type repository to ‘resolve’ the page type ID:&lt;/p&gt;  &lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;private &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt; GetPosts()
{
    &lt;span style=&quot;color: #2b91af&quot;&gt;PropertyCriteriaCollection &lt;/span&gt;criterias = &lt;span style=&quot;color: blue&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;PropertyCriteriaCollection&lt;/span&gt;();
    &lt;span style=&quot;color: #2b91af&quot;&gt;PropertyCriteria &lt;/span&gt;criteria = &lt;span style=&quot;color: blue&quot;&gt;new &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;PropertyCriteria&lt;/span&gt;();
    criteria.Condition = &lt;span style=&quot;color: #2b91af&quot;&gt;CompareCondition&lt;/span&gt;.Equal;
    criteria.Name = &lt;span style=&quot;color: #a31515&quot;&gt;&amp;quot;PageTypeID&amp;quot;&lt;/span&gt;;
    criteria.Type = &lt;span style=&quot;color: #2b91af&quot;&gt;PropertyDataType&lt;/span&gt;.PageType;
    criteria.Value = Locate.ContentTypeRepository().Load&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt;().ID.ToString();
    criteria.Required = &lt;span style=&quot;color: blue&quot;&gt;true&lt;/span&gt;;
    criterias.Add(criteria);
    &lt;span style=&quot;color: blue&quot;&gt;var &lt;/span&gt;posts = Locate.PageCriteriaQueryService().FindPagesWithCriteria(CurrentPage.ContentLink &lt;span style=&quot;color: blue&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;PageReference&lt;/span&gt;, criterias).Cast&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt;();
    &lt;span style=&quot;color: blue&quot;&gt;return &lt;/span&gt;EPiServer.Filters.&lt;span style=&quot;color: #2b91af&quot;&gt;FilterForVisitor&lt;/span&gt;.Filter(posts).Cast&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt;();
}&lt;/pre&gt;
&lt;p&gt;This works, and is as performant as FPWC is, but we have a problem with inheritance. What if we had a ‘DetailPage’ that is inherited from ‘StandardPage’? Because FPWC requires a page type ID, this won’t help us. We’ll only ever get StandardPage items back, never DetailPage ones. We could do two FPWC calls of course, but now we’re getting messy.&lt;/p&gt;
&lt;p&gt;So what’s the alternative? In old-style code the temptation would be to grab all the descendants then filter them ‘after the event’. You can do this using LINQ (bearing in mind that it’s actually still enumerating behind the scenes – this is not a highly performant way of doing things). At least the code is clean and we are dealing with real strong types so we respect inheritance – no need for page type IDs.&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;private &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt; GetPosts()
{
    &lt;span style=&quot;color: blue&quot;&gt;return &lt;/span&gt;EPiServer.Filters.&lt;span style=&quot;color: #2b91af&quot;&gt;FilterForVisitor&lt;/span&gt;.Filter(Locate.ContentRepository().GetDescendents(CurrentPage.ContentLink).Select(pageRef =&amp;gt; GetPage(pageRef &lt;span style=&quot;color: blue&quot;&gt;as &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;PageReference&lt;/span&gt;)).Where(page =&amp;gt; page &lt;span style=&quot;color: blue&quot;&gt;is &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;)).Cast&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt;();
}&lt;/pre&gt;
&lt;p&gt;However, there is now a better and badder way to do this. Although the Get&amp;lt;T&amp;gt; method doesn’t like you passing the incorrect page type as the generic type, the GetChildren&amp;lt;T&amp;gt; does automagical filtering for you to get the right type (including inherited types that can cast back to it). In essence, it’s doing pretty much what our code above does, but in less code and – probably – more efficiently:&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;private &lt;/span&gt;&lt;span style=&quot;color: #2b91af&quot;&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt; GetPosts()
{
    &lt;span style=&quot;color: blue&quot;&gt;return &lt;/span&gt;EPiServer.Filters.&lt;span style=&quot;color: #2b91af&quot;&gt;FilterForVisitor&lt;/span&gt;.Filter(GetChildren&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt;(CurrentPage.ContentLink)).Cast&amp;lt;&lt;span style=&quot;color: #2b91af&quot;&gt;StandardPage&lt;/span&gt;&amp;gt;();
}&lt;/pre&gt;
&lt;p&gt;For more detail on this, you can see the &lt;a href=&quot;http://world.episerver.com/Blogs/Johan-Bjornfot/Dates1/2012/8/EPiServer7-Working-with-IContentRepositoryDataFactory/&quot;&gt;related article in the SDK&lt;/a&gt;. Note that in all my examples I’m filtering the results for the visitor – this is an often-overlooked and crucial thing that you must do when doing things via the API! Using a PageList or similar web control, if using Web Forms, will do this filtering for you if you treat it nicely.&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>RSS Reader Block</title>
        <link href="http://world.episerver.com/Blogs/Jeff-Wallace/Dates/2013/5/RSS-Reader-Block/" />
        <id>http://world.episerver.com/Blogs/Jeff-Wallace/Dates/2013/5/RSS-Reader-Block/</id>
        <updated>2013-05-06T21:16:55.0000000Z</updated>
        <summary type="html">&lt;p&gt;&lt;em&gt;Based on EPiServer 7.1&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;EPiServer customers often want to use RSS on their sites. Some want to create RSS output from their pages, others may want to view it in a dashboard report, and others may simply want to consume a RSS source and syndicate it. Fortunately there are solutions for all of these. In this post however, I’m going to share a simple RSS Reader Block I’ve created. Once added to your site properly the usage is quite simple:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;1. Create a new “RSS Reader Block”:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/31887/2013/05/06/image_18.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;/Globals/xmlrpc/31887/2013/05/06/image_thumb_8.png&quot; width=&quot;244&quot; height=&quot;223&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;2. Configure the content items you desire:&lt;/p&gt;  &lt;blockquote&gt;   &lt;ul&gt;     &lt;li&gt;RSS Feed URL (required) - URL for the RSS feed&lt;/li&gt;      &lt;li&gt;Heading (optional) – Heading for the feed&lt;/li&gt;      &lt;li&gt;Description Text (optional) – Descriptive text for the feed&lt;/li&gt;      &lt;li&gt;Max Count (optional) – Maximum number of items to show in the list&lt;/li&gt;      &lt;li&gt;Include Publish Date (optional) – Whether or not to include publish date in the list&lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/31887/2013/05/06/image_9.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;/Globals/xmlrpc/31887/2013/05/06/image_thumb_2.png&quot; width=&quot;508&quot; height=&quot;589&quot; /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;3. Preview:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/31887/2013/05/06/image_14.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;/Globals/xmlrpc/31887/2013/05/06/image_thumb.png&quot; width=&quot;508&quot; height=&quot;374&quot; /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;4. Publish&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/31887/2013/05/06/image_20.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;/Globals/xmlrpc/31887/2013/05/06/image_thumb_7.png&quot; width=&quot;508&quot; height=&quot;555&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Additional example on Enoteca:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/31887/2013/05/06/image_11.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;/Globals/xmlrpc/31887/2013/05/06/image_thumb_4.png&quot; width=&quot;508&quot; height=&quot;401&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Get the code here…&lt;/p&gt;  &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:5a89b616-9f88-44fc-895e-918faa6b3355&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;&lt;p&gt; &lt;a href=&quot;/Globals/xmlrpc/31887/2013/05/06/RSSReaderBlock.1.0.0_1_1_1_1.nupkg&quot; target=&quot;_blank&quot;&gt;NuGet Package&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;hr /&gt;  &lt;ol&gt;   &lt;li&gt;&lt;em&gt;I made use of some of the styling from the Alloy Templates. As a result you may wish to tweak the styling a bit for your own needs. I left some commented out HTML in the view class in case it helps.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;The folder structure is based on one that mirrors the Alloy Templates thought installing on an Alloy site is not required.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;This NuGet package is a developer Add-on. This means it should be installed through Visual Studio and compiled as part of your project, not through the Add-on store UI in EPiServer.&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;&lt;em&gt;This is intended as a starting point for you to customize for your project needs. &lt;/em&gt;&lt;em&gt;The code is provided “as is” without warranty or guarantee of operation. Use at your own risk.&lt;/em&gt; &lt;/li&gt; &lt;/ol&gt;</summary>
    </entry>    <entry>
        <title>Related content with EPiServer Find</title>
        <link href="http://joelabrahamsson.com/related-content-with-episerver-find/" />
        <id>http://joelabrahamsson.com/related-content-with-episerver-find/</id>
        <updated>2013-05-06T07:40:00.0000000Z</updated>
        <summary type="html">Wether it&#39;s done for editorial content, products or recipes, linking to related content can be a good way to enrich a site. For visitors, for business and for SEO. While manually selecting what content to link to often produces the best results automatic functionality for displaying related complement can be a good complement.
&lt;p&gt;EPiServer Find has a number of methods that can be used for finding related or similar content. Combine them and they can offer a powerful way to help visitors find interesting content and improve search engine rankings through internal links.&lt;/p&gt;
&lt;h2&gt;Find similar pages using MoreLike&lt;/h2&gt;
&lt;p&gt;Built into Find&#39;s .NET API is a method named &lt;span class=&quot;code-concept&quot;&gt;MoreLike&lt;/span&gt;. It requires a string as argument and adds a query to a search request that will match indexed objects with similar text.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;SearchClient.Instance.Search&amp;lt;PageData&amp;gt;()
    &lt;strong&gt;.MoreLike(&quot;banana&quot;)&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;When using MoreLike the search results are ranked by how similar their texts are to the one we pass as argument to it. The similarity is essentially based on common words and there are &lt;a href=&quot;http://find.episerver.com/Documentation/dotnet-api-more-like-related-documents&quot;&gt;a number of adjustments&lt;/a&gt; that can be made to the algorithm to optimise it to suit the specific nature of the content on a specific site.&lt;/p&gt;
&lt;h2&gt;Add business logic using BoostMatching&lt;/h2&gt;
&lt;p&gt;On its own the result of the MoreLike method is highly dependent on the textual content on the site, producing varying results in terms of quality depending on the nature of the content on the site. It produces results based on similarity between texts but doesn&#39;t guarantee that there is any relation between the content other than shared usages of words in the text.&lt;/p&gt;
&lt;p&gt;Find&#39;s .NET API also features a method named &lt;span class=&quot;code-concept&quot;&gt;BoostMatching&lt;/span&gt; which can be used to apply boost factors using whatever criteria that can be described using a filter. In other words, pretty much anything. Using that we can upgrade a MoreLike query from producing &lt;em&gt;similar&lt;/em&gt; content to &lt;em&gt;related&lt;/em&gt; content.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;SearchClient.Instance.Search()
    .MoreLike(&quot;banana&quot;)
    &lt;strong&gt;.BoostMatching(x =&amp;gt; x.InCategory(42), 3)&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;What conditions we use for boosting is, naturally, dependent on the nature of the site and the type of content for which we want to find related content. If it&#39;s a blog post we may boost blog posts that share the same categories and tags. If it&#39;s a recipe site we may boost recipes that share the same ingredients. If it&#39;s a product we can boost based on categories, price and stock balance.&lt;/p&gt;
&lt;p&gt;In other words, BoostMatching allows us to apply custom business logic tailored for our specific site and needs of the business.&lt;/p&gt;
&lt;h2&gt;An example&lt;/h2&gt;
&lt;p&gt;On this site I have functionality to relate content using a number of mechanisms such as categories, tags and topics. If an article is grouped in a topic other articles in the same topic is listed.&lt;/p&gt;
&lt;p&gt;For articles that doesn&#39;t have such lists I still want to display a list of, as far as it&#39;s possible, related articles.&amp;nbsp;That&#39;s accomplished using the below method.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;//using System.Collections.Generic;
//using EPiServer.Find;
//using EPiServer.Find.Cms;
//using EPiServer.Find.Framework;

public virtual IEnumerable&amp;lt;EditorialPageBase&amp;gt; GetSimilarPages(EditorialPageBase page)
{
  //Create search request for pages of the type(s) that we&#39;re interested in
  //and apply a MoreLike query using the concatenated values of all searchable
  //properties on the current page.
  IQueriedSearch&amp;lt;EditorialPageBase&amp;gt; query = SearchClient.Instance
    .Search&amp;lt;EditorialPageBase&amp;gt;()
    .MoreLike(page.SearchText());

  //Apply major boost to articles in the same category.
  foreach (var category in page.Categories)
  {
    query = query.BoostMatching(x =&amp;gt; x.Categories.Match(category), 4);
  }

  //Apply a smaller but still significant boost to articles sharing tags with
  //the current page.
  foreach (var tagLink in page.TagReferences)
  {
    query = query.BoostMatching(x =&amp;gt; x.TagReferences.Match(tagLink.ToString()), 2);
  }

  return query
    //Utilize/apply editorial settings for how desirable a certain page
    //is in the results.
    .BoostMatching(x =&amp;gt; x.SearchPriority.Match(Priority.VeryLow), 0.1)
    .BoostMatching(x =&amp;gt; x.SearchPriority.Match(Priority.Low), 0.3)
    .BoostMatching(x =&amp;gt; x.SearchPriority.Match(Priority.High), 1.5)
    .BoostMatching(x =&amp;gt; x.SearchPriority.Match(Priority.Low), 2.5)
    //Exclude the current page (which is naturally the most similar page).
    .Filter(x =&amp;gt; !x.ContentLink.Match(page.ContentLink))
    //Exclude unpublished and filter based on access rights and language.    
    .FilterForVisitor()
    //Execute the query
    .Take(8)
    .GetContentResult(cacheForSeconds: 3600, cacheForEditorsAndAdmins: true);
}&lt;/pre&gt;
</summary>
    </entry>    <entry>
        <title>Localized EPiServer model validation attributes</title>
        <link href="http://www.tech-fellow.lv/?p=6312" />
        <id>http://www.tech-fellow.lv/?p=6312</id>
        <updated>2013-05-05T14:16:11.0000000Z</updated>
        <summary type="html">When it comes to validation the set of model validation attributes from DataAnnotations namespace in System.ComponentModel namespace is really handy. You can decorate model properties declaratively. [DisplayName(&amp;#34;The message&amp;#34;)] [Required] public string Message { get; set; } &amp;#160; However if you are dealing with multilingual site – you have possibility to specify resource name and type &lt;span class=&quot;ellipsis&quot;&gt;&amp;#8230;&lt;/span&gt; &lt;span class=&quot;more-link-wrap&quot;&gt;&lt;a href=&quot;http://www.tech-fellow.lv/2013/05/localized-episerver-model-validation-attributes/&quot; class=&quot;more-link&quot;&gt;&lt;span&gt;Read More ...&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;</summary>
    </entry>    <entry>
        <title>Create an animating slider with content area</title>
        <link href="http://world.episerver.com/Blogs/pezi/Dates/2013/5/Create-an-animating-slider-with-content-area/" />
        <id>http://world.episerver.com/Blogs/pezi/Dates/2013/5/Create-an-animating-slider-with-content-area/</id>
        <updated>2013-05-03T11:56:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;The content area is a is a list of multiple content references. That should work well for creating a slider, slideshow or whatever you call it. A list of items where not all of them is visible at the same time. There are too many   different JavaScript implementations for this. Depending on which you use, you might need to tweak the content area a little. Usually should be a list of items, but some also wants extra containers.&lt;/p&gt;
&lt;h2&gt;About the overlays&lt;/h2&gt;
&lt;p&gt;Before we start, let&#39;s mention the overlays. Edit mode uses overlays for the editable and visible properties on a page. The overlays are the clickable areas and the drop targets. When a page has loaded in the iframe, the editing base   finds all nodes that has a data-epi-property-name attribute. These nodes are passed to a overlayfactory which will create overlay items for the nodes. The overlays are absolutely positioned to cover the corresponding node in the template   page. This means that all nodes in the template that should be clickable to edit, must at least occupy some space. Floated elements in the template page can make the overlay get incorrect position and size. As the content area adds   container element around each block, it&#39;s easy to get the overlay misaligned by put floating styles on the block itself, but not on the block container. A container node with no styling and floated child elements will get zero height. The   overlay doesn&#39;t take overflow: hidden into the positioning either, which is a common issue when dealing with sliders. The content area uses a special overlay which has child block overlays. This is for sorting in on page edit, actions   through context menu and also the message to add blocks or pages when the area is empty.&lt;/p&gt;
&lt;h2&gt;First attempt to create a slider with a content area&lt;/h2&gt;
&lt;p&gt;I&#39;ll use &lt;a href=&quot;http://css-tricks.github.com/AnythingSlider/&quot;&gt;AnythingSlider&lt;/a&gt; as the example and use it in the Alloy templates. This script will create wrap the list in additional container Download it and put it in the Static   folder and name it &quot;anythingslider&quot;. The examples are for WebForms, Joel wrote about custom rendering in MVC: &lt;a href=&quot;http://joelabrahamsson.com/custom-rendering-of-content-areas/&quot;&gt;Custom rendering of content areas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Add a new content area called SliderContentArea to the start page model (EPiServer.Templates.Alloy.Models.Pages.StartPage)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
[Display(	
	GroupName = SystemTabNames.Content,
        Order = 330)]
	[CultureSpecific]
        public virtual ContentArea SliderContentArea { get; set; }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add the content area to the page template (EPiServer.Templates.Alloy.Views.Pages.StartPageTemplate)&lt;/p&gt;
&lt;p&gt;To simplify these examples I put the scripts and styles in the start page template.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;alloy:stylesheetlink runat=&quot;server&quot; href=&quot;~/Static/anythingslider/css/anythingslider.css&quot; /&amp;gt;
&amp;lt;alloy:scriptlink runat=&quot;server&quot; src=&quot;~/Static/anythingslider/js/jquery.anythingslider.js&quot; /&amp;gt;

&amp;lt;style&amp;gt;
    .slider {
    width: 400px;
    height: 240px;
    }

    .slider .mediaimg img {
        width: 100%;
    }

    .slider .border {
        width: 398px;
        height: 238px;
    }
&amp;lt;/style&amp;gt;

&amp;lt;!-- row and spanX is for Bootstrap framework --&amp;gt;
&amp;lt;div class=&quot;row&quot;&amp;gt;
    &amp;lt;div class=&quot;span3&quot;&amp;gt;
        &amp;lt;!-- property to illustrate problem with overlay --&amp;gt; 
        &amp;lt;episerver:property id=&quot;Property3&quot; runat=&quot;server&quot; propertyname=&quot;TeaserText&quot;&amp;gt;&amp;lt;/episerver:property&amp;gt;
    &amp;lt;/div&amp;gt; 
    &amp;lt;div class=&quot;span9&quot;&amp;gt; 
        &amp;lt;!-- render content area as a list --&amp;gt;
        &amp;lt;episerver:property id=&quot;Property1&quot; runat=&quot;server&quot; propertyname=&quot;SliderContentArea&quot;&amp;gt; 
        &amp;lt;rendersettings customtagname=&quot;ul&quot; cssclass=&quot;slider&quot; childrencustomtag=&quot;li&quot; /&amp;gt; &amp;lt;/episerver:property&amp;gt;
    &amp;lt;/div&amp;gt; 
&amp;lt;/div&amp;gt;

&amp;lt;!-- AnythingSlider initialization --&amp;gt;
&amp;lt;script&amp;gt;
    // DOM Ready
    $(function(){
        // Create the slider
        $(&#39;.slider&#39;).anythingSlider({
            autoPlay:true,
            buildStartStop:false,
            buildNavigation:false,
            enableNavigation:false,
            enableStartStop:false
       });
    });
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add 5 blocks to content area, use the start page blocks (except the jumbotron block).&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/PageFiles/127558/010.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Notice that all blocks are shown in a column, no slider yet. The content area overlay is also too big. This is because the slider script is only initialized when page is loaded the first time. When the property is updated with new items,   only the dom nodes inside the content area are replaced.&lt;/p&gt;
&lt;p&gt;Publish the page and when the page reloads there will be two slider on the page and looks better, except there are two sliders and extra block overlays that appears when the mouse cursor is beside the content area overlay. The teaser   text property gets a little less accessible, even though there still are some pixels left to click it. The overlay positioning the blocks overlays over where the actual node is. The double sliders are due to the custom content area in Alloy   templates, with max three items per row. Read more about the templates in Ted&#39;s post: &lt;a href=&quot;http://world.episerver.com/Articles/Items/Alloy-Templates-for-EPiServer-CMS-7/&quot;&gt;Templates for EPiServer 7 CMS&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/PageFiles/127558/020.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Fix the slider script initialization&lt;/h2&gt;
&lt;p&gt;Add it full page refresh to get the script render whenever we add a block. This is essential to have the slider be recreated when we add, remove or rearrange blocks.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
    public partial class StartPageTemplate : SiteTemplatePage
    {

        protected override void OnLoad(EventArgs e)
        {

            // Trigger full page reload when block is updated in edit mode
            // (requires FullRefreshPropertiesMetaData control in Root.Master)
            var page = Page as PageBase;

            if (page != null)
            {
                if (!page.EditHints.Contains(&quot;SliderContentArea&quot;))
                {
                    page.EditHints.Add(&quot;SliderContentArea&quot;);
                }
            }
        }
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Fix the rendering&lt;/h2&gt;
&lt;p&gt;We can implement a custom content area that fixes the rendering as the normal content area, but it will also support extra rendering options. The RenderSettings is a dictionary and can included not known keys for a more generic content   area. This implementation adds support for two extra keys innerCustomTagName and innerCssClass. The downside with custom keys are that you get no intellisense for them. So if you use a slider script that want an extra container around the   list, this will do the job for you. Otherwise it&#39;ll work as the default content area implementation.&lt;/p&gt;
&lt;p&gt;Create new class in EPiServer.Templates.Alloy.Business.WebControls.&lt;/p&gt;
&lt;h2&gt;Custom content area&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;
using System;
using System.Web.UI.HtmlControls;
using EPiServer.Core;
using EPiServer.Web.PropertyControls;
using EPiServer.Web.WebControls;
using EPiServer.Framework.DataAnnotations;
using EPiServer.Web;

namespace EPiServer.Templates.Alloy.Business.WebControls
{
    /// 
    /// Provides custom rendering of content areas to enable one more level of markup
    /// 
    [TemplateDescriptor(TagString = &quot;SliderContentAreaTag&quot;)]
    public class SliderContentAreaControl : PropertyContentAreaControl, IRenderTemplate    
    {

        /// 
        /// Creates block controls for the blocks in the block area. Used when the property is in view mode
        /// or in &quot;on page edit&quot; mode and the PropertyDataControl does not support on page editing.
        /// 
        public override void CreateDefaultControls()
        {
            CreateContentAreaControls(false);
        }

        /// 
        /// Creates the &quot;on page edit&quot; controls with the blocks.
        /// If no block exist, this method will do nothing.
        /// 
        public override void CreateOnPageEditControls()
        {
            CreateContentAreaControls(PropertyIsEditableForCurrentLanguage());
        }

        private void CreateContentAreaControls(bool enableEditFeatures)
        {
            // Get list of block renderers
            var controlList = GetContentRenderers(EnableEditFeaturesForChildren || enableEditFeatures);

            // get outer container tag name
            var containerTagName = !String.IsNullOrWhiteSpace(CustomTagName) ? CustomTagName : &quot;div&quot;;

            // get inner container tag name
            var innerContainerTagName = &quot;div&quot;;

            // use custom render settings key
            if (RenderSettings.ContainsKey(&quot;innerCustomTagName&quot;))
            {
                var tag = (string)RenderSettings[&quot;innerCustomTagName&quot;];
                if (!String.IsNullOrWhiteSpace(tag))
                {
                    innerContainerTagName = tag;
                }
            }

            // Create containers
            HtmlGenericControl container = CreateMainContainer(enableEditFeatures, containerTagName);
            HtmlGenericControl innerContainer = new HtmlGenericControl(innerContainerTagName);

            // add class for inner
            // use custom render settings key for classs
            if (RenderSettings.ContainsKey(&quot;innerCssClass&quot;))
            {
                var cssClass = (string)RenderSettings[&quot;innerCssClass&quot;];
                if (!String.IsNullOrWhiteSpace(cssClass))
                {
                    innerContainer.Attributes.Add(&quot;class&quot;, cssClass);
                }
            }

            // Add controls
            this.Controls.Add(container);
            container.Controls.Add(innerContainer);

            foreach (ContentRenderer block in controlList)
            {
                innerContainer.Controls.Add(block);
                block.EnsureChildControlsCreated();
            }
        }

        /// The default implementation simply checks the IsNull property
        protected override bool ShouldCreateDefaultControls()
        {
            return PropertyData != null &amp;amp;&amp;amp; !PropertyData.IsNull;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Use the custom content area for slider property&lt;/h2&gt;
&lt;p&gt;Add Tag to render settings on Change the property name to get the correct rendering, now we don&#39;t get the extra classes used for the Alloy content areas and the blocks aren&#39;t wrapped on multiple rows. I also added support for setting an   innerContainer to the inner class. Note the use of Tag to make sure we get SliderContentAreaControl and not the SitePropertyContentAreaControl (which is the default ).&lt;/p&gt;
&lt;p&gt;Reload edit and there&#39;s only one slider, but the overlay for the content area is now even worse. If look at the page on the site the structure this for the slider:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/PageFiles/127558/030.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;AnythingSlider wraps the slider in two divs, the inner is a viewport with overflow hidden. Let&#39;s look at the rendered slider i edit mode. I usually hold down control/command and click on a page in the top navigation inside the preview   frame. The template page will be opened in a new tab with the needed query string parameters ( .../,,4/?id=4&amp;amp;epieditmode=true ). Inspect the slider and we&#39;ll see that the data-epi-attributes are attached to the slider UL. This causes   the overlay to be too big because it will position itself according to the UL. We want the epi attributes to be on the anythingSlider div.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/PageFiles/127558/040.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Move the edit attributes&lt;/h2&gt;
&lt;p&gt;Let&#39;s add some script to fix this. The script in the template page will execute before the edit UI finds the editable nodes, so we can move the attributes without any problem.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
     // DOM Ready
     $(function () {

        // Create the slider
         $(&#39;.slider&#39;).anythingSlider({
             autoPlay: true,
             buildStartStop: false,
             buildNavigation: false,
             enableNavigation: false,
             enableStartStop: false
         }).each(function (index, item) {

            // move all data-epi-attributes to the injected parent slider node
             var i;
             var epiAttributes = {};
             var attr;
             var name;

             for (i = item.attributes.length - 1; i &amp;gt;= 0; i--) {

                 attr = item.attributes[i];
                 name = attr.nodeName;

                // starts with &quot;data-epi&quot;?
                 if (name.indexOf(&quot;data-epi-&quot;) === 0) {
                     epiAttributes[name] = attr.nodeValue;
                     item.removeAttribute(name);
                     attr = null;
                }
             }

            // set attributes to parent node
             $(item).parents(&quot;.anythingSlider&quot;).attr(epiAttributes);
         });
     });
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we&#39;ll get a better sized overlay for the content area. The overlay is now only calculated for the outer property. But there&#39;s still the block overlays that are in the way. We can use the default property overlay to remove the block   overlays.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/PageFiles/127558/050.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2&gt;Use default overlay&lt;/h2&gt;
&lt;h3&gt;Create an editor descriptor&lt;/h3&gt;
&lt;p&gt;Create a new class called SliderPropertyContentAreaEditorDescriptor.cs. In the editor descriptor we can specify a custom overlay, or use default by not specify any at all. The default overlay can&#39;t handle list items and we must remove drag   and drop support.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
using EPiServer.Core;
using EPiServer.Shell.ObjectEditing;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EPiServer.Templates.Alloy.Business.EditorDescriptors
{
    [EditorDescriptorRegistration(TargetType = typeof(ContentArea), UIHint = &quot;SliderPropertyContentArea&quot;)]
    public class SliderPropertyContentAreaEditorDescriptor : EditorDescriptor
    {
        public SliderPropertyContentAreaEditorDescriptor()
        {
            ClientEditingClass = &quot;epi-cms.contentediting.editors.ContentAreaEditor&quot;;
        }

        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
        {
            base.ModifyMetadata(metadata, attributes);

            // cancel DnD
            metadata.AdditionalValues[&quot;DropTargetType&quot;] = new string[] { };
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Use the editor descriptor for the slider property&lt;/h3&gt;
&lt;p&gt;Annotate the model with UIHint to get the custom overlay in edit mode. It&#39;s the key to be able to use this for a specific property in the model.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
        [UIHint(&quot;SliderPropertyContentArea&quot;)]
        public virtual ContentArea SliderContentArea { get; set; }
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;The final result&lt;/h2&gt;
&lt;p&gt;Reload edit to get the final result. Items can be added, removed and reordered in the flyout editor.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/PageFiles/127558/060.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Programing changes required while Upgrading Episerver Commerce R2 to R2 SP1 and R2SP2 - Part 2</title>
        <link href="http://world.episerver.com/Blogs/K-Khan-/Dates/2013/5/Programing-changes-required-while-Upgrading-Episerver-Commerce-R2-to-R2-SP1-and-R2SP2---Part-2/" />
        <id>http://world.episerver.com/Blogs/K-Khan-/Dates/2013/5/Programing-changes-required-while-Upgrading-Episerver-Commerce-R2-to-R2-SP1-and-R2SP2---Part-2/</id>
        <updated>2013-05-03T07:20:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;I will be thankful if you can add your experiences also in comments so others developers will have an idea of all issues in one basket. It will help you to estimate time required for upgrading also depending on your projects.&lt;/p&gt;  &lt;p&gt;       &lt;p&gt;&lt;strong&gt;7: error related to loading EPiServer.Factory dll&lt;/strong&gt;      &lt;br /&gt;Disable the processPaymentActivity in POSaveChangesWorkflow if you&amp;#160; have the error related to loading EPiServer.Factory dll.&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;       &lt;p&gt;&lt;strong&gt;8: WOrkflow changes required if using some custom workflows&lt;/strong&gt;      &lt;br /&gt;Add the SplitShipment activity to CartPrepareWorfklow. Remove any payments / shipment before calling CartPrepareWorkflow.&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;9: Backward compatability issue.&lt;/strong&gt;       &lt;br /&gt;In Commerce R2SP1, the CalculateTotalActivity calculates the ExtendedPrice following PlacePrice.      &lt;br /&gt;item.ExtendedPrice = item.PlacedPrice * item.Quantity - item.LineItemDiscountAmount - item.OrderLevelDiscountAmount;      &lt;br /&gt;subTotal += item.PlacedPrice * item.Quantity - item.LineItemDiscountAmount;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;It proved a nightmare for me as all taxes and discounts were wrong and it took long to understand this. In 1.0 SP1, the ExtendedPrice assessed by ListPrice.   &lt;br /&gt;item.ExtendedPrice = item.ListPrice * item.Quantity - item.LineItemDiscountAmount -item.OrderLevelDiscountAmount;    &lt;br /&gt;subTotal += item.ListPrice * item.Quantity - item.LineItemDiscountAmount;&lt;/p&gt;  &lt;p&gt;if using custom cartprepare workflows then change the code in Custom CarePrepareWorkflow back to ListPrice to show the correct price. Check Front Site which field you are using using also.&lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;     &lt;p&gt;&lt;strong&gt;10: R2SP2 setup always fails if there is some failure first time.&lt;/strong&gt;        &lt;br /&gt;Issue: If the SP2 automated update fails then the Tools.zip file is removed during the rollback routine. Once this file has been removed any future attempts to run the update will fail due to this file being missing. Therefore before continuing make a backup of this file.        &lt;br /&gt;&lt;/p&gt;      &lt;p&gt;Fix: For R2SP2 Backup ‘&amp;lt;website root&amp;gt;\MediachaseECF\Tools.zip’ &lt;/p&gt;   &lt;/p&gt; &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;11: Commerce Manager Issue:&lt;/strong&gt;      &lt;br /&gt;Issue: On Migrating to R2SP2 I got an issue in Commerce Manager. It was not loading Meta classes and was giving exception as below      &lt;br /&gt;[IndexOutOfRangeException: ParameterIndex]&amp;#160;&amp;#160; System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) +6277902&amp;#160;&amp;#160; System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) +249&amp;#160;&amp;#160; System.Data.SqlClient.SqlDataReader.get_Item(String name) +23&amp;#160;&amp;#160; Mediachase.MetaDataPlus.Configurator.MetaField.GetList(MetaClass metaClass) +404&amp;#160;&amp;#160; Mediachase.Commerce.Manager.Core.MetaData.Admin.MetaClassesControl.BindItemsGrid(Int32 id) +646&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;       &lt;p&gt;Fix: Deploy Some SPs manually on DB. Find Unzip Mediachase.ECF.SDK.5.2.zip under C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Commerce 1.1.2.62\MediachaseECF and Unzip it at location e.g. E:\InstallSP2\Mediachase.ECF.SDK.5.2 and execute below scripts      &lt;br /&gt;C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Commerce 1.1.2.62\Setup\cms_db_upgrade.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_ApplicationSystem_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_BusinessFoundation_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_CatalogSystem_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_MarketingSystem_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_MetaDataSystem_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_OrderSystem_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_Reporting_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_SecuritySystem_update.sql      &lt;br /&gt;E:\InstallSP2\Mediachase.ECF.SDK.5.2\Data\DeploymentPackage\SqlScripts\Update\ecf_db_Users_upgrade.sql      &lt;br /&gt;C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Install\Modules\EPiServer Commerce 1.1.2.62\Setup\ecf_products_ProductsQuery.sql&lt;/p&gt;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>PageType Usage Plugin with Recent Pages for each PageType</title>
        <link href="http://world.episerver.com/Blogs/Eric-Vanderfeesten/Dates/2013/5/PageType-Usage-Plugin-with-Recent-Pages-for-each-PageType/" />
        <id>http://world.episerver.com/Blogs/Eric-Vanderfeesten/Dates/2013/5/PageType-Usage-Plugin-with-Recent-Pages-for-each-PageType/</id>
        <updated>2013-05-02T10:31:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;To get more insight in the production environment of the client, we needed some information on the usage of PageTypes and the number of pages for each PageType. Further, in case of troubleshooting or support we needed a way to quickly retrieve the URL of a page for a given PageType. The simplest approach was to build a small admin plugin that summarizes this information in an extensive but generic way without the need to look up or manually query for certain pages. This post will show you how the plugin was set up and what the end result looks like.&lt;/p&gt;  &lt;p&gt;The main part of the plugin is a GuiPlugin that targets the PlugInArea.AdminMenu. I’ll show you how the page layout was setup and how the code behind looks like. Further we need a few helper classes that retrieve the actual data from the EPiServer database.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;End result&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Let’s start with the end result. I’ve used the AlloyTech templates for this demo. Below you’ll see two screenshots. The first displays the statistics for each PageType and the second displays the page URLs for each PageType. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/53565/2013/05/02/PageTypeUsage-tabStatistics_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;PageTypeUsage-tabStatistics&quot; border=&quot;0&quot; alt=&quot;PageTypeUsage-tabStatistics&quot; src=&quot;/Globals/xmlrpc/53565/2013/05/02/PageTypeUsage-tabStatistics_thumb.png&quot; width=&quot;244&quot; height=&quot;159&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Figure 1: &lt;em&gt;Page Type statistics&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/53565/2013/05/02/PageTypeUsage-tabRecentPages_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;PageTypeUsage-tabRecentPages&quot; border=&quot;0&quot; alt=&quot;PageTypeUsage-tabRecentPages&quot; src=&quot;/Globals/xmlrpc/53565/2013/05/02/PageTypeUsage-tabRecentPages_thumb.png&quot; width=&quot;244&quot; height=&quot;191&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Figure 2:&lt;em&gt; Recent pages for each PageType&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Page Layout&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Now you’ve seen the end result, we’ll get into how this plugin is created. We’ll start with the page layout first.&lt;/p&gt;  &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;   &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;     &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &amp;lt;asp:Content ContentPlaceHolderID=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;FullRegion&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &amp;lt;EPiServerUI:TabStrip runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; id=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;actionTab&amp;quot;&lt;/span&gt; GeneratesPostBack=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;False&amp;quot;&lt;/span&gt; targetid=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;tabView&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;             &amp;lt;EPiServerUI:Tab Text=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Page Type Usage&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;TabUsage&amp;quot;&lt;/span&gt; Sticky=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;             &amp;lt;EPiServerUI:Tab Text=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Pages&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;TabPages&amp;quot;&lt;/span&gt; Sticky=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &amp;lt;/EPiServerUI:TabStrip&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     &amp;lt;asp:Panel runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; id=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;tabView&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;         &amp;lt;asp:Panel runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Usage&amp;quot;&lt;/span&gt; CssClass=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;epi-contentContainer epi-padding&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;             &amp;lt;h1&amp;gt;Page Type Usage&amp;lt;/h1&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;             &amp;lt;asp:GridView ID=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeGridView&amp;quot;&lt;/span&gt; runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;                 AutoGenerateColumns=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; AllowSorting=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; AllowPaging=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;                 Width=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;100%&amp;quot;&lt;/span&gt; OnSorting=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeGridViewSorting&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;                 &amp;lt;Columns&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;                     &amp;lt;asp:BoundField DataField=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeId&amp;quot;&lt;/span&gt; HeaderText=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeId&amp;quot;&lt;/span&gt; SortExpression=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeId&amp;quot;&lt;/span&gt;  /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;                     &amp;lt;asp:BoundField DataField=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeName&amp;quot;&lt;/span&gt; HeaderText=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeName&amp;quot;&lt;/span&gt; SortExpression=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeName&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;                     &amp;lt;asp:BoundField DataField=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;CountPages&amp;quot;&lt;/span&gt; HeaderText=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;CountPages&amp;quot;&lt;/span&gt; SortExpression=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;CountPages&amp;quot;&lt;/span&gt;  /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;                     &amp;lt;asp:BoundField DataField=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;CountWorkPages&amp;quot;&lt;/span&gt; HeaderText=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;CountWorkPages&amp;quot;&lt;/span&gt; SortExpression=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;CountWorkPages&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;                 &amp;lt;/Columns&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;             &amp;lt;/asp:GridView&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;         &amp;lt;/asp:Panel&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;         &amp;lt;asp:Panel runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Pages&amp;quot;&lt;/span&gt; CssClass=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;epi-padding&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;             &amp;lt;h1&amp;gt;Pages by PageType&amp;lt;/h1&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;             &amp;lt;asp:Literal runat=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageUrlsLiteral&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;         &amp;lt;/asp:Panel&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;     &amp;lt;/asp:Panel&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt; &amp;lt;/asp:Content&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;The page layout consists of a &lt;em&gt;TabStrip&lt;/em&gt; with two Tabs. We’ll use the first tab for the statistical part and the second tab for the page URLs part. In order to get the Tabs working we’ll need two Panels. The first panel, for our statistical part, uses a &lt;em&gt;GridView&lt;/em&gt; with four columns for PageTypeId, PageTypeName, the number of pages, and the number of work pages. Of course the amount of information of each PageType could be extended, but for now this already provides some insight in the way PageTypes are being used in the production environment.&lt;/p&gt;
&lt;p&gt;The second part lists the most recent pages for each PageType. We’ll construct the complete listing from code behind which will be places in the PageUrlsLiteral. Building html from a code behind of course is never the best approach, but it’ll do for now. I’ll get into the page URLs in more detail later on.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Plugin code behind&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The second part is setting up our code behind for the GuiPlugin.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; [GuiPlugIn(&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     DisplayName = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Page Type Usage&amp;quot;&lt;/span&gt;, &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     Description = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Displays statistics and actual pages for each page type&amp;quot;&lt;/span&gt;, &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     Area = PlugInArea.AdminMenu, &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;     Url = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;~/Business/PageTypeStats/PageTypeStatsPlugin.aspx&amp;quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; PageTypeStatsPlugin : SystemPageBase&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;readonly&lt;/span&gt; EPiServerSqlHelper _ePiServerSqlHelper = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; EPiServerSqlHelper();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; OnPreInit(EventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.OnPreInit(e);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;// Set system masterpage&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.MasterPageFile = ResolveUrlFromUI(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MasterPages/EPiServerUI.master&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; OnInit(EventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!EPiServer.Security.PrincipalInfo.HasEditAccess)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;             Response.Write(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;You do not have access rights to this page&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;             Response.End();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; OnLoad(EventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;.OnLoad(e);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;         BindPageTypes();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum31&quot;&gt;  31:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum32&quot;&gt;  32:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; BindPageTypes()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum33&quot;&gt;  33:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum34&quot;&gt;  34:&lt;/span&gt;         List&amp;lt;PageTypeUsage&amp;gt; list = _ePiServerSqlHelper.GetPageTypeUsage();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum35&quot;&gt;  35:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum36&quot;&gt;  36:&lt;/span&gt;         PageTypeGridView.DataSource = list;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum37&quot;&gt;  37:&lt;/span&gt;         PageTypeGridView.AllowPaging = &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum38&quot;&gt;  38:&lt;/span&gt;         PageTypeGridView.DataBind();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum39&quot;&gt;  39:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum40&quot;&gt;  40:&lt;/span&gt;         PageUrlsLiteral.Text = GetPageUrls();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum41&quot;&gt;  41:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum42&quot;&gt;  42:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum43&quot;&gt;  43:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; GetPageUrls()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum44&quot;&gt;  44:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum45&quot;&gt;  45:&lt;/span&gt;         List&amp;lt;PageUrlByPageType&amp;gt; list = _ePiServerSqlHelper.GetPageUrlByPageType();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum46&quot;&gt;  46:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum47&quot;&gt;  47:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; colgroupFormat = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;&amp;lt;colgroup&amp;gt;&amp;lt;col /&amp;gt;&amp;lt;col style=&#39;width:50px;&#39; /&amp;gt;&amp;lt;col style=&#39;width:50px;&#39; /&amp;gt;&amp;lt;/colgroup&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum48&quot;&gt;  48:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; headerFormat = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;{0}&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;{1}&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;{2}&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum49&quot;&gt;  49:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; pageTypeFormat = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;&amp;lt;tr style=&#39;background-color:#DEDEDE;&#39;&amp;gt;&amp;lt;td&amp;gt;{0}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{1}&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;{2}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum50&quot;&gt;  50:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; pageFormat = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td colspan=&#39;3&#39;&amp;gt;{0}&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum51&quot;&gt;  51:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum52&quot;&gt;  52:&lt;/span&gt;         StringBuilder sb = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; StringBuilder();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum53&quot;&gt;  53:&lt;/span&gt;         sb.Append(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;&amp;lt;table cellspacing=&#39;0&#39; border=&#39;0&#39; style=&#39;border-style:None;width:100%;border-collapse:collapse;&#39; class=&#39;epi-default epi-default-legacy&#39;&amp;gt;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum54&quot;&gt;  54:&lt;/span&gt;         sb.Append(colgroupFormat);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum55&quot;&gt;  55:&lt;/span&gt;         sb.AppendFormat(headerFormat, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageTypeID&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;CountPages&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum56&quot;&gt;  56:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum57&quot;&gt;  57:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;foreach&lt;/span&gt; (var pageUrlByPageType &lt;span style=&quot;color: #0000ff&quot;&gt;in&lt;/span&gt; list)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum58&quot;&gt;  58:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum59&quot;&gt;  59:&lt;/span&gt;             sb.AppendFormat(pageTypeFormat, pageUrlByPageType.PageTypeName,&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum60&quot;&gt;  60:&lt;/span&gt;                 pageUrlByPageType.PageTypeId, pageUrlByPageType.CountPages);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum61&quot;&gt;  61:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum62&quot;&gt;  62:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;foreach&lt;/span&gt; (var pageUrls &lt;span style=&quot;color: #0000ff&quot;&gt;in&lt;/span&gt; pageUrlByPageType.PageUrls)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum63&quot;&gt;  63:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum64&quot;&gt;  64:&lt;/span&gt;                 sb.AppendFormat(pageFormat, pageUrls.PageUrl);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum65&quot;&gt;  65:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum66&quot;&gt;  66:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum67&quot;&gt;  67:&lt;/span&gt;         sb.Append(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;&amp;lt;/table&amp;gt;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum68&quot;&gt;  68:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum69&quot;&gt;  69:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; sb.ToString();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum70&quot;&gt;  70:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum71&quot;&gt;  71:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;There is probably more in depth information available on how to set up a GuiPlugin, so I won’t be covering all the basics here but I’ll try to keep this short. Limited to five steps actually.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;First you add the &lt;em&gt;GuiPlugin&lt;/em&gt; attribute on the class.&lt;/li&gt;
  &lt;li&gt;In the O&lt;em&gt;nPreInit&lt;/em&gt; method you assign the correct masterpage.&lt;/li&gt;
  &lt;li&gt;In the &lt;em&gt;OnInit &lt;/em&gt;method we’ll limit access to the plugin to edit rights.&lt;/li&gt;
  &lt;li&gt;The &lt;em&gt;BindPageTypes&lt;/em&gt; method is called from the &lt;em&gt;OnLoad&lt;/em&gt; method and retrieves the data and assigns the data to the GridView.&lt;/li&gt;
  &lt;li&gt;The &lt;em&gt;GetPageUrls&lt;/em&gt; method retrieves the data for our second tab, the actual URLs for the pages. This retrieves a collection, iterates over the results and build the html for our list which is then assigned to our literal placeholder.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;While our GuiPlugin has been set up with these five steps, we still need to cover the actual retrieval of the data required for the PageType information we want to expose.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Query the database&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;There are three basic queries needed to retrieve all the information needed. The three queries are mentioned below.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; SqlPageTypeUsage = &lt;span style=&quot;color: #006080&quot;&gt;@&amp;quot;SELECT pt.pkID AS Id, pt.Name AS Name, &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;         pt.Filename AS FileName, COUNT(p.pkID) AS PageCount &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;         FROM tblPage AS p RIGHT OUTER JOIN tblPageType AS pt ON p.fkPageTypeID = pt.pkID &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;         GROUP BY pt.Name, pt.Filename, pt.SortOrder, pt.pkID &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;         ORDER BY pt.Name, pt.SortOrder&amp;quot;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; SqlCountWorkPages = &lt;span style=&quot;color: #006080&quot;&gt;@&amp;quot;SELECT COUNT(*) AS PageCount FROM tblWorkPage &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;         INNER JOIN tblPage ON tblWorkPage.fkPageID = tblPage.pkID &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;         WHERE (tblPage.fkPageTypeID = {0})&amp;quot;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; SqlTop10PagesByPageType = &lt;span style=&quot;color: #006080&quot;&gt;@&amp;quot;SELECT TOP 10 [pkID] AS Id &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;         FROM tblPage WHERE Deleted=&#39;0&#39; AND PendingPublish=&#39;0&#39; AND fkPageTypeID = &#39;{0}&#39; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;         ORDER BY pkID DESC&amp;quot;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;The first query ‘&lt;em&gt;SqlPageTypeUsage&lt;/em&gt;’ selects the information from tblPage and tblPageType and groups this on PageType. At this point we have most of the information on the first tab, the statistical information. &lt;/p&gt;
&lt;p&gt;Further the information is extended with the number of workPages. The second query ‘&lt;em&gt;SqlCountWorkPages&lt;/em&gt;’ will retrieve this information from tblWorkPage.&lt;/p&gt;
&lt;p&gt;The third query ‘&lt;em&gt;SqlTop10PagesByPageType&lt;/em&gt;’ retrieves the top 10 pages from tblPage on the given PageType. I’ve ordered this on the Page ID, since the most recent pages will have the newest ID. Of course you could order it on change date or publish date of the page version, but at this point ordering on ID gives us a good enough insight in the recent pages.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Domain objects&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Next we defined three simple objects to hold the data which we can use in our plugin. These are PageTypeUsage which will hold the statistical tab, PageUrlByPageType and PageUrls to hold the recent pages for each PageType.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; PageTypeUsage&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; PageTypeName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; PageTypeId { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; FileName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; CountPages { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; CountWorkPages { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; PageUrlByPageType&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; PageTypeName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; PageTypeId { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; CountPages { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; List&amp;lt;PageUrls&amp;gt; PageUrls { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; PageUrls&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; PageId { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; PageUrl { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Retrieve the data&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The next part is the method &lt;em&gt;GetPageTypeUsage&lt;/em&gt; which executes the SQL statement and parses en returns the results. We check if the PageType has a filename and exclude the &lt;em&gt;sysrecylebin&lt;/em&gt; and &lt;em&gt;sysroot&lt;/em&gt;. Further we call the SQL statement to count the number of WorkPages.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// Gets the usage of pagetypes.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; List&amp;lt;PageTypeUsage&amp;gt; GetPageTypeUsage()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     List&amp;lt;PageTypeUsage&amp;gt; results = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; List&amp;lt;PageTypeUsage&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     SqlConnection conn = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; SqlConnection(ConfigurationManager.ConnectionStrings[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;EPiServerDB&amp;quot;&lt;/span&gt;].ConnectionString);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;         SqlCommand cmd = conn.CreateCommand();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;         cmd.CommandType = CommandType.Text;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;         cmd.CommandText = SqlPageTypeUsage;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;         conn.Open();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; (IDataReader dataReader = cmd.ExecuteReader())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;while&lt;/span&gt; (dataReader.Read())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; id;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;.TryParse(dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;].ToString(), &lt;span style=&quot;color: #0000ff&quot;&gt;out&lt;/span&gt; id))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;                     Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error parsing Id&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; pageCount;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;.TryParse(dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageCount&amp;quot;&lt;/span&gt;].ToString(), &lt;span style=&quot;color: #0000ff&quot;&gt;out&lt;/span&gt; pageCount))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt;                     Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error parsing PageCount&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum31&quot;&gt;  31:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum32&quot;&gt;  32:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum33&quot;&gt;  33:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum34&quot;&gt;  34:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;FileName&amp;quot;&lt;/span&gt;] == &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum35&quot;&gt;  35:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum36&quot;&gt;  36:&lt;/span&gt;                     Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error parsing FileName&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum37&quot;&gt;  37:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum38&quot;&gt;  38:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum39&quot;&gt;  39:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum40&quot;&gt;  40:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;].ToString().ToLower() == &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;sysrecyclebin&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum41&quot;&gt;  41:&lt;/span&gt;                     || dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;].ToString().ToLower() == &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;sysroot&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum42&quot;&gt;  42:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum43&quot;&gt;  43:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum44&quot;&gt;  44:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum45&quot;&gt;  45:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum46&quot;&gt;  46:&lt;/span&gt;                 PageTypeUsage pageTypeUsage = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PageTypeUsage&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum47&quot;&gt;  47:&lt;/span&gt;                     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum48&quot;&gt;  48:&lt;/span&gt;                         PageTypeId = id,&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum49&quot;&gt;  49:&lt;/span&gt;                         PageTypeName = (&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;)dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;],&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum50&quot;&gt;  50:&lt;/span&gt;                         FileName = (&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;)dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;FileName&amp;quot;&lt;/span&gt;],&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum51&quot;&gt;  51:&lt;/span&gt;                         CountPages = pageCount,&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum52&quot;&gt;  52:&lt;/span&gt;                         CountWorkPages = GetNumberOfPagesForPageTypeFromDatabase(id, SqlCountWorkPages)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum53&quot;&gt;  53:&lt;/span&gt;                     };&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum54&quot;&gt;  54:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum55&quot;&gt;  55:&lt;/span&gt;                 results.Add(pageTypeUsage);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum56&quot;&gt;  56:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum57&quot;&gt;  57:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum58&quot;&gt;  58:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum59&quot;&gt;  59:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum60&quot;&gt;  60:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum61&quot;&gt;  61:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; errorMessage = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error occured retrieving pagetype usage&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum62&quot;&gt;  62:&lt;/span&gt;         Logger.Error(errorMessage);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum63&quot;&gt;  63:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Exception(errorMessage, ex);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum64&quot;&gt;  64:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum65&quot;&gt;  65:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;finally&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum66&quot;&gt;  66:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum67&quot;&gt;  67:&lt;/span&gt;         conn.Close();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum68&quot;&gt;  68:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum69&quot;&gt;  69:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum70&quot;&gt;  70:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; results;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum71&quot;&gt;  71:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum72&quot;&gt;  72:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum73&quot;&gt;  73:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum74&quot;&gt;  74:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// Gets the number of pages a for page type from database.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum75&quot;&gt;  75:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum76&quot;&gt;  76:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&amp;quot;pageTypeId&amp;quot;&amp;gt;Page type id to count pages for&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum77&quot;&gt;  77:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;param name=&amp;quot;query&amp;quot;&amp;gt;Query to run against database&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum78&quot;&gt;  78:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum79&quot;&gt;  79:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; GetNumberOfPagesForPageTypeFromDatabase(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; pageTypeId, &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; query)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum80&quot;&gt;  80:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum81&quot;&gt;  81:&lt;/span&gt;     SqlConnection conn = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; SqlConnection(ConfigurationManager.ConnectionStrings[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;EPiServerDB&amp;quot;&lt;/span&gt;].ConnectionString);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum82&quot;&gt;  82:&lt;/span&gt;     SqlCommand cmd = conn.CreateCommand();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum83&quot;&gt;  83:&lt;/span&gt;     cmd.CommandType = CommandType.Text;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum84&quot;&gt;  84:&lt;/span&gt;     cmd.CommandText = &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.Format(query, pageTypeId);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum85&quot;&gt;  85:&lt;/span&gt;     conn.Open();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum86&quot;&gt;  86:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; pageCount = cmd.ExecuteScalar();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum87&quot;&gt;  87:&lt;/span&gt;     conn.Close();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum88&quot;&gt;  88:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum89&quot;&gt;  89:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;)pageCount;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum90&quot;&gt;  90:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum91&quot;&gt;  91:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Finally to retrieve the pages for each PageType we also execute the SQL statement and return the results. The first is similar to the above code when retrieving the PageTypes. For each PageType we call the &lt;em&gt;GetTop10PagesByPageType&lt;/em&gt; method that collects the recent pages for the PageType. For each retrieved Page we also need to construct the absolute URL. In the method ‘&lt;em&gt;GetUrlFromPageId&lt;/em&gt;’ we take in a page id and convert that to the absolute URL of the page.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; List&amp;lt;PageUrlByPageType&amp;gt; GetPageUrlByPageType()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     List&amp;lt;PageUrlByPageType&amp;gt; results = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; List&amp;lt;PageUrlByPageType&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     SqlConnection conn = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; SqlConnection(ConfigurationManager.ConnectionStrings[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;EPiServerDB&amp;quot;&lt;/span&gt;].ConnectionString);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;         SqlCommand cmd = conn.CreateCommand();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;         cmd.CommandType = CommandType.Text;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;         cmd.CommandText = SqlPageTypeUsage;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;         conn.Open();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; (IDataReader dataReader = cmd.ExecuteReader())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;while&lt;/span&gt; (dataReader.Read())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; id;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;.TryParse(dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;].ToString(), &lt;span style=&quot;color: #0000ff&quot;&gt;out&lt;/span&gt; id))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;                     Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error parsing Id&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; pageCount;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;.TryParse(dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;PageCount&amp;quot;&lt;/span&gt;].ToString(), &lt;span style=&quot;color: #0000ff&quot;&gt;out&lt;/span&gt; pageCount))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;                     Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error parsing PageCount&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;] == &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum31&quot;&gt;  31:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum32&quot;&gt;  32:&lt;/span&gt;                     Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error parsing Name&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum33&quot;&gt;  33:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum34&quot;&gt;  34:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum35&quot;&gt;  35:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum36&quot;&gt;  36:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;].ToString().ToLower() == &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;sysrecyclebin&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum37&quot;&gt;  37:&lt;/span&gt;                     || dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;].ToString().ToLower() == &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;sysroot&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum38&quot;&gt;  38:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum39&quot;&gt;  39:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum40&quot;&gt;  40:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum41&quot;&gt;  41:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum42&quot;&gt;  42:&lt;/span&gt;                 PageUrlByPageType pageUrlByPageType = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PageUrlByPageType&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum43&quot;&gt;  43:&lt;/span&gt;                     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum44&quot;&gt;  44:&lt;/span&gt;                         PageTypeId = id,&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum45&quot;&gt;  45:&lt;/span&gt;                         PageTypeName = (&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;)dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;],&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum46&quot;&gt;  46:&lt;/span&gt;                         CountPages = pageCount,&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum47&quot;&gt;  47:&lt;/span&gt;                         PageUrls = GetTop10PagesByPageType(id)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum48&quot;&gt;  48:&lt;/span&gt;                     };&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum49&quot;&gt;  49:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum50&quot;&gt;  50:&lt;/span&gt;                 results.Add(pageUrlByPageType);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum51&quot;&gt;  51:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum52&quot;&gt;  52:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum53&quot;&gt;  53:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum54&quot;&gt;  54:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum55&quot;&gt;  55:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum56&quot;&gt;  56:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; errorMessage = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error occured retrieving pagetype usage&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum57&quot;&gt;  57:&lt;/span&gt;         Logger.Error(errorMessage);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum58&quot;&gt;  58:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Exception(errorMessage, ex);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum59&quot;&gt;  59:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum60&quot;&gt;  60:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;finally&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum61&quot;&gt;  61:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum62&quot;&gt;  62:&lt;/span&gt;         conn.Close();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum63&quot;&gt;  63:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum64&quot;&gt;  64:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum65&quot;&gt;  65:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; results;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum66&quot;&gt;  66:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum67&quot;&gt;  67:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum68&quot;&gt;  68:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum69&quot;&gt;  69:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// Gets the top 10 pages for a pagetype&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum70&quot;&gt;  70:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum71&quot;&gt;  71:&lt;/span&gt; &lt;span style=&quot;color: #008000&quot;&gt;/// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum72&quot;&gt;  72:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; List&amp;lt;PageUrls&amp;gt; GetTop10PagesByPageType(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; pageTypeId)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum73&quot;&gt;  73:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum74&quot;&gt;  74:&lt;/span&gt;     List&amp;lt;PageUrls&amp;gt; results = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; List&amp;lt;PageUrls&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum75&quot;&gt;  75:&lt;/span&gt;     SqlConnection conn = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; SqlConnection(ConfigurationManager.ConnectionStrings[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;EPiServerDB&amp;quot;&lt;/span&gt;].ConnectionString);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum76&quot;&gt;  76:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum77&quot;&gt;  77:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum78&quot;&gt;  78:&lt;/span&gt;         SqlCommand cmd = conn.CreateCommand();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum79&quot;&gt;  79:&lt;/span&gt;         cmd.CommandType = CommandType.Text;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum80&quot;&gt;  80:&lt;/span&gt;         cmd.CommandText = &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.Format(SqlTop10PagesByPageType, pageTypeId);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum81&quot;&gt;  81:&lt;/span&gt;         conn.Open();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum82&quot;&gt;  82:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum83&quot;&gt;  83:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; (IDataReader dataReader = cmd.ExecuteReader())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum84&quot;&gt;  84:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum85&quot;&gt;  85:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;while&lt;/span&gt; (dataReader.Read())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum86&quot;&gt;  86:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum87&quot;&gt;  87:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; id;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum88&quot;&gt;  88:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt;.TryParse(dataReader[&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Id&amp;quot;&lt;/span&gt;].ToString(), &lt;span style=&quot;color: #0000ff&quot;&gt;out&lt;/span&gt; id))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum89&quot;&gt;  89:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum90&quot;&gt;  90:&lt;/span&gt;                     Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error parsing Id&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum91&quot;&gt;  91:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum92&quot;&gt;  92:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum93&quot;&gt;  93:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum94&quot;&gt;  94:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; url = GetUrlFromPageId(id);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum95&quot;&gt;  95:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(url))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum96&quot;&gt;  96:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum97&quot;&gt;  97:&lt;/span&gt;                     &lt;span style=&quot;color: #0000ff&quot;&gt;continue&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum98&quot;&gt;  98:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum99&quot;&gt;  99:&lt;/span&gt;                 PageUrls pageUrls = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PageUrls&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum100&quot;&gt; 100:&lt;/span&gt;                     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum101&quot;&gt; 101:&lt;/span&gt;                         PageId = id,&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum102&quot;&gt; 102:&lt;/span&gt;                         PageUrl = url&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum103&quot;&gt; 103:&lt;/span&gt;                     };&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum104&quot;&gt; 104:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum105&quot;&gt; 105:&lt;/span&gt;                 results.Add(pageUrls);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum106&quot;&gt; 106:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum107&quot;&gt; 107:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum108&quot;&gt; 108:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum109&quot;&gt; 109:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum110&quot;&gt; 110:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum111&quot;&gt; 111:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;const&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; errorMessage = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Error occured retrieving Top10PagesByPageType&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum112&quot;&gt; 112:&lt;/span&gt;         Logger.Error(errorMessage);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum113&quot;&gt; 113:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Exception(errorMessage, ex);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum114&quot;&gt; 114:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum115&quot;&gt; 115:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;finally&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum116&quot;&gt; 116:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum117&quot;&gt; 117:&lt;/span&gt;         conn.Close();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum118&quot;&gt; 118:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum119&quot;&gt; 119:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum120&quot;&gt; 120:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; results;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum121&quot;&gt; 121:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum122&quot;&gt; 122:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum123&quot;&gt; 123:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; GetUrlFromPageId(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; id)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum124&quot;&gt; 124:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum125&quot;&gt; 125:&lt;/span&gt;     PageData page = DataFactory.Instance.GetPage(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PageReference(id));&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum126&quot;&gt; 126:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (page.LinkType == PageShortcutType.External)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum127&quot;&gt; 127:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum128&quot;&gt; 128:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum129&quot;&gt; 129:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum130&quot;&gt; 130:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum131&quot;&gt; 131:&lt;/span&gt;     UrlBuilder ub = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; UrlBuilder(page.LinkURL);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum132&quot;&gt; 132:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum133&quot;&gt; 133:&lt;/span&gt;     EPiServer.Web.FriendlyUrlRewriteProvider urm = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; EPiServer.Web.FriendlyUrlRewriteProvider();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum134&quot;&gt; 134:&lt;/span&gt;     urm.ConvertToExternal(ub, page.PageLink, Encoding.UTF8);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum135&quot;&gt; 135:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum136&quot;&gt; 136:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; siteUrl = EPiServer.Configuration.Settings.Instance.SiteUrl.AbsoluteUri;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum137&quot;&gt; 137:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (siteUrl.EndsWith(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;/&amp;quot;&lt;/span&gt;))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum138&quot;&gt; 138:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum139&quot;&gt; 139:&lt;/span&gt;         siteUrl = siteUrl.TrimEnd(&lt;span style=&quot;color: #006080&quot;&gt;&#39;/&#39;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum140&quot;&gt; 140:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum141&quot;&gt; 141:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.Concat(siteUrl, ub.Uri.ToString());&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum142&quot;&gt; 142:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum143&quot;&gt; 143:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That’s it. In the above post I’ve explained the use of the plugin and how you can develop it. This plugin has proven to be very useful in support for any client question on pages, and for debugging purposes as well. This plugin provides a good insight in the way your editors are using the defined PageTypes and how they use them to create pages. Hopefully this post has helped you to understand the basics and explained the use of it in everyday production environments. &lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Programing changes required while Upgrading Episerver Commerce R2 to R2SP1 and R2SP2 - Part 1</title>
        <link href="http://world.episerver.com/Blogs/K-Khan-/Dates/2013/5/Programing-changes-required-while-Upgrading-Episerver-Commerce-R2-to-R2SP1-and-R2SP2---Part-1/" />
        <id>http://world.episerver.com/Blogs/K-Khan-/Dates/2013/5/Programing-changes-required-while-Upgrading-Episerver-Commerce-R2-to-R2SP1-and-R2SP2---Part-1/</id>
        <updated>2013-05-02T09:03:57.0000000Z</updated>
        <summary type="html">&lt;p&gt;   &lt;p&gt;Below is summary of issue that we have faced in upgrading different sites from R2 to R2SP1 and R2SP2. &lt;/p&gt;     &lt;/p&gt;  &lt;h2&gt;Basic steps&lt;/h2&gt;  &lt;p&gt;&lt;a href=&quot;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-Commerce/Upgrading-EPiServer-Commerce-from-version-1-R2-to-1-R2-SP1-/&quot;&gt;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-Commerce/Upgrading-EPiServer-Commerce-from-version-1-R2-to-1-R2-SP1-/&lt;/a&gt;    &lt;br /&gt;And    &lt;br /&gt;&lt;a href=&quot;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-Commerce/Upgrading-EPiServer-Commerce-from-version-1-R2-SP1-to-1-R2-SP2-/&quot;&gt;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-Commerce/Upgrading-EPiServer-Commerce-from-version-1-R2-SP1-to-1-R2-SP2-/&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;&amp;#160;&lt;/h2&gt;  &lt;h2&gt;&amp;#160;&lt;/h2&gt;  &lt;h2&gt;&amp;#160;&lt;/h2&gt;  &lt;h2&gt;Breaking changes:&lt;/h2&gt;  &lt;p&gt;&lt;strong&gt;1 - Issue:     &lt;br /&gt;&lt;/strong&gt;If you try to import the business foundation object / meta-class but you get Access Denied exception. Please check the access to the path     &lt;br /&gt;%CommerceManager%\\app_data\\ImportExport\\Commerce Manager\\metadata&#39;. &lt;/p&gt;  &lt;p&gt;Fix:   &lt;br /&gt;If this folder doesn’t exist, please create it.&lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;2 - IShippingGateway:&lt;/strong&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;Issue:    &lt;br /&gt;Backward compatability Issue. In Commerce R2SP1, IShippingGateway required implement ShippingRate GetRate(Guid methodId, Shipment shipment, ref string message), not ShippingRate GetRate(Guid methodId, LineItem[] items, ref string message). &lt;/p&gt;  &lt;p&gt;Fix:   &lt;br /&gt;Therefore you need to add the new implementation for GetRate in your custom ShippingGateway and change all the call to GetRate function. Then rebuild the solution.&lt;/p&gt;  &lt;p&gt;       &lt;p&gt;&lt;strong&gt;3 - Browsing the site and see the error:&lt;/strong&gt;      &lt;br /&gt;Issue:      &lt;br /&gt;The Type &#39;EPiServer.Business.Commerce.CommerceSettings&#39; needs to be remapped in the Dynamic Data Store, see the Errors collection for more information.&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;Fix:   &lt;br /&gt;Remapping can be done by applying the EPiServer.Data.Dynamic.EPiServerDataStoreAttribute attribute to the type,    &lt;br /&gt;setting its AutomaticallyRemapStore property to true and ensuring the &amp;lt;episerver.dataStore&amp;gt;&amp;lt;dataStore&amp;gt; autoRemapStores attribute in web.config is set to true (or is not defined).    &lt;br /&gt;Alternatively call the Upgrade-EPiRemapDDSTypes cmdlet from Powershell.&lt;/p&gt;  &lt;p&gt;Please run these commands in PowerShell:   &lt;br /&gt;Add-PSSnapin EPiServer.Framework.Install.6.2.267.1    &lt;br /&gt;Upgrade-EPiRemapDDSTypes -ApplicationPath $applicationPath -Type &amp;quot;EPiServer.Business.Commerce.CommerceSettings&amp;quot;     &lt;br /&gt;$appllicationPath is the path to root folder of cms site.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;4 - Changes in index data and searching for catalognode:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If we want to search for the entries/products in a catalognode, we need to use the _outline field. The code should look like this:   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (String.IsNullOrEmpty(categoryCode))    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var productRootNode = CatalogContext.Current.GetCatalogNodes(CommerceSettings.Default.MainCatalogName, CommerceSettings.Default.ProductNodeCode);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (productRootNode.CatalogNode.Count() &amp;lt;= 0)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return new List&amp;lt;Entry&amp;gt;();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; foreach (var node in productRootNode.CatalogNode)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //criteria.CatalogNodes.Add(node.ID);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; //criteria.CatalogNodes.Add(categoryCode);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; criteria.Outlines = SearchFilterHelper.GetOutlinesForNode(categoryCode);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; criteria.CatalogNames.Add(CommerceSettings.Default.MainCatalogName);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; criteria.StartingRecord = 0;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; criteria.RecordsToRetrieve = 1000;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; var entries = SearchFilterHelper.Current.SearchEntries(criteria, out count,   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; entryResponseGroup, false,    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; new TimeSpan(0, 0, 0));    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (entries.TotalResults == 0)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;5 - After rebuilding and building the index, you can get the exception when searching on the site, you can get exception:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Issue:   &lt;br /&gt;System.IndexOutOfRangeException was unhandled by user code    &lt;br /&gt;&amp;#160; Message=Index was outside the bounds of the array.    &lt;br /&gt;&amp;#160; Source=Lucene.Net    &lt;br /&gt;&amp;#160; StackTrace:    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at Lucene.Net.Index.DocumentsWriter.Abort(AbortException ae)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; at Lucene.Net.Index.DocumentsWriter.UpdateDocument(Document doc, Analyzer analyzer, Term delTerm)&lt;/p&gt;  &lt;p&gt;Fix:   &lt;br /&gt;The can be fixed by applying the CustomSearchProvider.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;6 - Add the AuthorizedPaymentTotal by code when you see the error below:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Issue:   &lt;br /&gt;Cannot insert the value NULL into column &#39;AuthorizedPaymentTotal&#39;, table &#39;dbEPiServerCommerce.dbo.OrderForm&#39;; column does not allow nulls. UPDATE fails.    &lt;br /&gt;The statement has been terminated.     &lt;br /&gt;Exception Details: System.Data.SqlClient.SqlException: Cannot insert the value NULL into column &#39;AuthorizedPaymentTotal&#39;, table ‘dbEPiServerCommerce.dbo.OrderForm&#39;; column does not allow nulls. UPDATE fails.    &lt;br /&gt;The statement has been terminated.&lt;/p&gt;  &lt;p&gt;Fix:   &lt;br /&gt;//workaround for these fields not accepting nulls    &lt;br /&gt;cart.Cart.OrderForms[0].AuthorizedPaymentTotal = 0;     &lt;br /&gt;cart.Cart.OrderForms[0].CapturedPaymentTotal = 0;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Indexing only referenced VPP-files with EPiServer Find</title>
        <link href="http://www.lindstromhenrik.com/indexing-only-referenced-vpp-files-with-episerver-find" />
        <id>http://www.lindstromhenrik.com/indexing-only-referenced-vpp-files-with-episerver-find</id>
        <updated>2013-05-02T05:00:00.0000000Z</updated>
        <summary type="html">The EPiServer Find CMS integration does not index any files stored in the VPP by default. A convention is included in the integration that index files visible in the file manager and it is enabled by setting the VisibleInFilemanagerVPPIndexingConvention on the FilieIndexer conventions...</summary>
    </entry>    <entry>
        <title>List of XForm System Localization Keys in EPiServer 7</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/30/list-of-xform-system-localization-keys-in-episerver-7" />
        <id>http://cjsharp1.github.io/blog/2013/04/30/list-of-xform-system-localization-keys-in-episerver-7</id>
        <updated>2013-05-01T04:27:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;I&#39;ve recently been working on translating text that is displayed along with an XForm property. Since the localizations that are shipped with EPiServer 7 are now embedded in the assemblies, it&#39;s not as easy as searching through an XML file for the keys you need to override. So, as a reference, here are the system localization keys related to XForms that are embedded into EPiServer 7.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;p&gt;These are keys and values:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/xform/datatypes/date1/caption: Date (DD/MM/YYYY) 
/xform/datatypes/date1/inlineerrormessage: Not a valid date. Please enter a date in the format &quot;DD/MM/YYYY&quot;. 
/xform/datatypes/date1/summaryerrormessage: * is not a valid date. Please enter a date in the format &quot;DD/MM/YYYY&quot;. 
/xform/datatypes/date2/caption: Date (MM/DD/YYYY) 
/xform/datatypes/date2/inlineerrormessage: Not a valid date. Please enter a date in the format &quot;MM/DD/YYYY&quot;. 
/xform/datatypes/date2/summaryerrormessage: * is not a valid date. Please enter a date in the format &quot;MM/DD/YYYY&quot;. 
/xform/datatypes/defaulttype/inlineerrormessage: You have entered characters that are not permitted (&quot;&amp;lt;&quot; or &quot;&amp;gt;&quot;). 
/xform/datatypes/defaulttype/summaryerrormessage: You have entered characters that are not permitted (&quot;&amp;lt;&quot; or &quot;&amp;gt;&quot;). 
/xform/datatypes/email/caption: E-mail address 
/xform/datatypes/email/inlineerrormessage: Not a valid e-mail address. 
/xform/datatypes/email/summaryerrormessage: * is not a valid e-mail address. 
/xform/datatypes/integer/caption: Integer 
/xform/datatypes/integer/inlineerrormessage: Not a valid integer. 
/xform/datatypes/integer/summaryerrormessage: * is not a valid integer. 
/xform/datatypes/isodate/caption: Date (YYYY-MM-DD) 
/xform/datatypes/isodate/inlineerrormessage: Not a valid date. Please enter a date in the format &quot;YYYY-MM-DD&quot;. 
/xform/datatypes/isodate/summaryerrormessage: * is not a valid date. Please enter a date in the format &quot;YYYY-MM-DD&quot;. 
/xform/datatypes/positiveinteger/caption: Positive integer 
/xform/datatypes/positiveinteger/inlineerrormessage: Not a valid positive integer. 
/xform/datatypes/positiveinteger/summaryerrormessage: * is not a valid positive integer. 
/xform/denymultipleposts: You have already filled in this form 
/xform/errorpostingtocustomurl: The form could not be sent to a custom address 
/xform/errorpostingtodatabase: The form could not be sent to the database 
/xform/errorpostingtoemail: The form could not be sent to an e-mail address 
/xform/requiredfield/inlineerrormessage: This field is required 
/xform/requiredfield/summaryerrormessage: You haven&#39;t specified all required fields 
/xform/requiredfield/summaryerrormessageformat: You have not specified the required field &quot;{0}&quot;. 
/xform/requirelogon: You must be logged in to answer
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see, the keys are primarily used to supply the error messages for the validations, and are unrelated to the localization of any other elements in the XForm.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://cjsharp.com/blog/2013/04/11/working-with-localization-and-language-branches-in-episerver-7-mvc/&quot;&gt;As I mentioned in a previous post&lt;/a&gt;, the old &#39;lang&#39; folder has disappeared with the release of EPiServer 7, and &lt;a href=&quot;http://sdkbeta.episerver.com/SDK-html-Container/?path=/SdkDocuments/EPiServerFramework/7/Knowledge%20Base/Developer%20Guide/Localization/Replacing%20LanguageManager%20with%20LocalizationService.htm&amp;amp;vppRoot=/SdkDocuments//EPiServerFramework/7/Knowledge%20Base/Developer%20Guide/&quot;&gt;the documentation explained why&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;If you want to override the system localizations that are shipped with EPiServer products, you will notice that the language files are no longer installed in the lang folder. They are now instead embedded in the assemblies but just as before you can override individual string by placing your own language XML in the lang folder. Of course you can include your localizations through any other LocalizationProvider and they will take precedence over the system localizations as long as the provider is registered before the system ones.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;These translations live in the &#39;en&#39; language branch, which is EPiServer&#39;s default language branch. With the proper localization fallback behavior configured, you&#39;ll see these translations for any language branch. If you want to customize the translations for the &#39;en&#39; language branch, or for a completely different language branch, you would just need add them to your own language XML file and specify the language, which would look something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;
&amp;lt;languages&amp;gt;
  &amp;lt;language name=&quot;English (United States)&quot; id=&quot;en-US&quot;&amp;gt;
    &amp;lt;xform&amp;gt;
      &amp;lt;requirelogon&amp;gt;Custom logged in alert&amp;lt;/requirelogon&amp;gt;
      &amp;lt;datatypes&amp;gt;
        &amp;lt;email&amp;gt;
          &amp;lt;inlineerrormessage&amp;gt;Custom email error&amp;lt;/inlineerrormessage&amp;gt;
        &amp;lt;/email&amp;gt;
      &amp;lt;/datatypes&amp;gt;
    &amp;lt;/xform&amp;gt;
  &amp;lt;/language&amp;gt;
&amp;lt;/languages&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you&#39;re curious about the code I used to get the list, it&#39;s actually pretty simple. You could easily customize this code to retrieve any other system localization areas that you need to override:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var resources = LocalizationService.Current.GetAllStrings().Where(t =&amp;gt; t.Key.StartsWith(&quot;/xform&quot;)).ToList();
&lt;/code&gt;&lt;/pre&gt;
</summary>
    </entry>    <entry>
        <title>Installing Lucene Solr for EPiServer Commerce (EPi 6) Catalog Search</title>
        <link href="http://jorgedoig.com/?p=74" />
        <id>http://jorgedoig.com/?p=74</id>
        <updated>2013-04-30T12:53:13.0000000Z</updated>
        <summary type="html">By default, EPiServer Commerce uses Apache Lucene to perform its catalog search. Though within the files in Commerce Manager there exists Solr. They provide the&#160;necessary&#160;files to install Solr to your Apache search. Why Solr over Lucene? Well Solr wraps around&lt;span class=&quot;ellipsis&quot;&gt;&amp;#8230;&lt;/span&gt;&lt;div class=&quot;read-more&quot;&gt;&lt;a href=&quot;http://jorgedoig.com/installing-lucene-solr-for-episerver-commerce-epi-6-catalog-search/&quot;&gt;Read more &amp;#8250;&lt;/a&gt;&lt;/div&gt;&lt;!-- end of .read-more --&gt;</summary>
    </entry>    <entry>
        <title>The annoying “error CS1031: Type expected” after upgrade site from CMS5R2 to CMS6</title>
        <link href="http://world.episerver.com/Blogs/Jonas-Lindau/Dates/2013/4/The-annoying-error-CS1031-Type-expected-after-upgrade-site-from-CMS5R2-to-CMS6/" />
        <id>http://world.episerver.com/Blogs/Jonas-Lindau/Dates/2013/4/The-annoying-error-CS1031-Type-expected-after-upgrade-site-from-CMS5R2-to-CMS6/</id>
        <updated>2013-04-30T09:01:43.0000000Z</updated>
        <summary type="html">&lt;p&gt;A few days ago a colleague upgraded a EPiServer site using Deployment Center and got this strange error. According to the dump the error was related to /Shell/Views/Shared/Site.Master. I knew the site was working correctly on my development machine, and I also knew the site was working fine in the test environment, so I ruled out any code-issues. Since there was already a lot of sites running on the production servers I also ruled out any missing dependencies. So what’s left? The Web.config of course!&lt;/p&gt;  &lt;p&gt;The natural approach to find the error was to compare the non-working web.config in the production environment, with the working web.config from the test environment. That turned out to be an easy task since the only thing that was different was three lines, all which had to do with MVC!&lt;/p&gt;  &lt;p&gt;For some reason Deployment Center didn’t care to replace the version of MVC on the production servers. It worked for the same site on my development machine and for the test servers. It also always worked for other sites on out production servers, but not this time.&lt;/p&gt;  &lt;p&gt;So what I did was change the version numbers for System.Web.Mvc as below:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;This is how it looked after upgrade&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;dependentAssembly&amp;gt;   &lt;br /&gt;&amp;#160; &amp;lt;assemblyIdentity name=&amp;quot;System.Web.Mvc&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; culture=&amp;quot;neutral&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;bindingRedirect oldVersion=&amp;quot;1.0.0.0-1.65535.65535.65535&amp;quot; newVersion=&amp;quot;1.0.0.0&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;/dependentAssembly&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;compilation defaultLanguage=&amp;quot;c#&amp;quot; debug=&amp;quot;false&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160; &amp;lt;assemblies&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;add assembly=&amp;quot;System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;/assemblies&amp;gt;    &lt;br /&gt;&amp;lt;/compilation&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;pages validateRequest=&amp;quot;false&amp;quot; enableEventValidation=&amp;quot;false&amp;quot; pageParserFilterType=&amp;quot;System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;This is what I did change to make it work&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;dependentAssembly&amp;gt;   &lt;br /&gt;&amp;#160; &amp;lt;assemblyIdentity name=&amp;quot;System.Web.Mvc&amp;quot; publicKeyToken=&amp;quot;31bf3856ad364e35&amp;quot; culture=&amp;quot;neutral&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;bindingRedirect oldVersion=&amp;quot;1.0.0.0-2.0.0.0&amp;quot; newVersion=&amp;quot;2.0.0.0&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;/dependentAssembly&amp;gt;    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;compilation defaultLanguage=&amp;quot;c#&amp;quot; debug=&amp;quot;false&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160; &amp;lt;assemblies&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;add assembly=&amp;quot;System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;/assemblies&amp;gt;    &lt;br /&gt;&amp;lt;/compilation&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;pages validateRequest=&amp;quot;false&amp;quot; enableEventValidation=&amp;quot;false&amp;quot; pageParserFilterType=&amp;quot;System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35&amp;quot;&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And the error is gone!&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>EditPanel Manager</title>
        <link href="http://world.episerver.com/Blogs/Eric-Vanderfeesten/Dates/2013/4/EditPanel-Manager/" />
        <id>http://world.episerver.com/Blogs/Eric-Vanderfeesten/Dates/2013/4/EditPanel-Manager/</id>
        <updated>2013-04-29T21:00:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;In order to keep the Edit Panel as clean as can be, I’ve written a small extension that enhances the ability to disable and hide buttons in the EditPanel for specific PageTypes. This post explains the setup for the EditPanelManager extension, which options it currently supports and how the implementation has been done. The main objective of this post is to give insight in a possible solution to the problem and should not by default be read as the best solution. While all code is usable and tested it could well be optimized at places.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The challenge&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The Edit Panel, as you probably know, is one of the areas for which you can use a GuiPlugIn with Area set to PlugInArea.EditPanel to add custom tabs. With these tabs you can add specific functionality to pages or PageTypes for instance which can improve the work for your editors in case you need to provide some functionality that otherwise would mean manual selection or at least non trivial work.&lt;/p&gt;  &lt;p&gt;While this is a great way to extend your specific pages or PageTypes, adding a multitude of these custom GuiPlugIns can make the Edit Panel a bit overwhelming to your editors in the number of tabs they see. Most of the times however your editors won’t be using all of these tabs frequently. Some tabs probably won’t be used at all throughout the site, and perhaps some tabs are only used for a specific PageType.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The basics&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This extension uses an xml configuration file to manage the tabs in the EditPanel for our PageTypes. I’ll start by explaining this configuration. Further down the post I’ll show how we can hook into EPiServer to influence the actual tabs being displayed in the EditPanel.&lt;/p&gt;  &lt;p&gt;Let’s start with the structure of the xml configuration file. This will explain all of the options that are available in this extension and will provide the basis insights on what to do with those options.&lt;/p&gt;  &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;   &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;     &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &amp;lt;episervereditpanelmanager&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;   &amp;lt;pagetypes&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &amp;lt;type name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MyPageTypeName&amp;quot;&lt;/span&gt; active=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MyDefaultEditPanelTab&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;       &amp;lt;properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MyFirstEditPanelTabName&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MySecondEditPanelTabName&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; ignoreroles=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;MyUserRole&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;       &amp;lt;/properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     &amp;lt;/type&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;   &amp;lt;/pagetypes&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt; &amp;lt;/episervereditpanelmanager&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The type element&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Within the ‘&lt;em&gt;pagetypes&lt;/em&gt;’ node you set up a ‘&lt;em&gt;type&lt;/em&gt;’ element. Each type element reflects a single PageType in your EPiServer site structure. The are two attributes on the type element. The first is the ‘&lt;em&gt;name&lt;/em&gt;’ attribute, which is mandatory. The name attribute contains the name of the PageType that you want to manage the EditPanel tabs for. The second attribute is the ‘&lt;em&gt;active&lt;/em&gt;’ attribute, which is optional. This attribute contains the name of the EditPanel tab that you want to set as the default tab which is displayed when an editor selects a page from the PageTree (Note: if this is the same for all your PageTypes or there is no need to customize this for each PageType you should probably use the ‘uiDefaultPanelTab’ in your EPiServer site configuration).&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The property element&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Within the type element there is a single ‘&lt;em&gt;properties&lt;/em&gt;’ element that contains a number of ‘&lt;em&gt;property&lt;/em&gt;’ elements. Each property element reflects a tab that exists in the EditPanel; like the Preview tab, the Edit tab, the Workflow tab, the Version List tab etc. The are three attributes on the property element. The first is the ‘&lt;em&gt;name&lt;/em&gt;’ attribute, which is mandatory. The name attribute contains the name of the EditPanel tab that you want to manage. The second attribute is the ‘&lt;em&gt;enable&lt;/em&gt;’ attribute, also mandatory. The enable attribute is a Boolean and holds the values ‘true’ or ‘false’. If set to true, the EditPanel tab should be displayed. If set to false the EditPanel tab should not be displayed. The third attribute is the ‘&lt;em&gt;ignoreroles&lt;/em&gt;’ attribute, which is optional. This attribute can hold a comma separated list of user roles. This works as an override to the enable attribute. Users from these user roles are not taken into account on the enable attribute. In the above example this means that the ‘MySecondEditPanelTabName’ is not visible to anyone, except users from the ‘MyUserRole’ user role.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Hopefully you’re still reading ;) The summary above highlights the functional use of the EditPanelManager extension. The next part will explain some more on how this can be achieved with some code examples as well. Before we get into that just another small example xml configuration. &lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pop quiz&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Try and see if you understand how this would affect the EditPanel of your site editors (Note: spoiler below the example!)&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &amp;lt;episervereditpanelmanager&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;   &amp;lt;pagetypes&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &amp;lt;type name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;TeaserPageType&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;       &amp;lt;properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;View&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;       &amp;lt;/properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     &amp;lt;/type&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     &amp;lt;type name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;NewsPageType&amp;quot;&lt;/span&gt; active=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;       &amp;lt;properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;View&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Version List&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Workflow&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Statistics&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;       &amp;lt;/properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;     &amp;lt;/type&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;     &amp;lt;type name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;EventPageType&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;       &amp;lt;properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;View&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Edit&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; ignoreroles=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;WebAdmins, WebEditors&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Version List&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; ignoreroles=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;WebAdmins, WebEditors&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Workflow&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; ignoreroles=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;WebAdmins, WebEditors&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;         &amp;lt;property name=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Statistics&amp;quot;&lt;/span&gt; enable=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;false&amp;quot;&lt;/span&gt; ignoreroles=&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;WebAdmins, WebEditors&amp;quot;&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;       &amp;lt;/properties&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;     &amp;lt;/type&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;   &amp;lt;/pagetypes&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt; &amp;lt;/episervereditpanelmanager&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Ok, so how does the above configuration affect our editors?&lt;/p&gt;
&lt;p&gt;Once logged in, I won’t see the View tab in the EditPanel for the TeaserPageType. Further I won’t see the VersionList, Workflow and Statistics tab on the NewsPageType, and the Edit tab is the default tab when selecting a page of type NewsPageType in the PageTree. If the logged in user has the ‘WebAdmins’ user role he’ll see all five tabs on the EventPageType. If the logged in user has the ‘WebSpecialAdmins’ user role, he’ll only see the ‘View’ tab in the EditPanel.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Technical Implementation&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;So far for the examples. As promised I’ll dive into the actual implementation.&lt;/p&gt;
&lt;p&gt;We start by creating a GuiPlugIn. Let’s call this ‘EditPanelManager’.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; [GuiPlugIn(Area = PlugInArea.EditPanel)]&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; EditPanelManager : ICustomPlugInLoader&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;readonly&lt;/span&gt; ILog Logger = LogManager.GetLogger(&lt;span style=&quot;color: #0000ff&quot;&gt;typeof&lt;/span&gt;(EditPanelManager));&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;//property that holds the current page type config element&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; EPiServerEditPanelManagerPageTypeConfigElement CurrentPageTypeConfigElement&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;         get; set;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; PlugInDescriptor[] List()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//hook LoadComplete-event on EditPanel page&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;         EPiServer.UI.Edit.EditPanel editPanel = HttpContext.Current.Handler &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; EPiServer.UI.Edit.EditPanel;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt; != editPanel)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;             &lt;span style=&quot;color: #008000&quot;&gt;//ADD SOME LOGIC HERE&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//Never return a plugin - we don&#39;t want to add tabs.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PlugInDescriptor[0] { };&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; EditPanelLoadComplete(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//ADD SOME LOGIC HERE&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;The next step is to implement the ‘&lt;i&gt;PlugInDescriptor[] List()&lt;/i&gt;’ method from the &lt;em&gt;ICustomPlugInLoader&lt;/em&gt; interface. In short we add an EventHandler to LoadComplete of the EditPanel if the PageType of the current page exists in our xml configuration file.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; PlugInDescriptor[] List()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// hook LoadComplete-event on EditPanel page&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     EPiServer.UI.Edit.EditPanel editPanel = HttpContext.Current.Handler &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; EPiServer.UI.Edit.EditPanel;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt; != editPanel)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//get the list of all registered pagetypes from the config file&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;         List&amp;lt;EPiServerEditPanelManagerPageTypeConfigElement&amp;gt; pageTypeList = EditPanelManagerHelper.GetPageTypeNamesFromConfig();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//check if the pagetype of the current page exists in the list of pagetypes in the config file&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;             CurrentPageTypeConfigElement = pageTypeList.First(x =&amp;gt; x.Name.ToLower().Trim() == editPanel.CurrentPage.PageTypeName.ToLower().Trim());&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;             Logger.Debug(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;error occured while getting the CurrentPageTypeConfigElement&amp;quot;&lt;/span&gt;, ex);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;             &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//match found, add the event handler to the LoadComplete event of the editpanel&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (CurrentPageTypeConfigElement != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;             editPanel.LoadComplete += EditPanelLoadComplete;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;//Never return a plugin - we don&#39;t want to add tabs.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PlugInDescriptor[0] { };&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The EventHandler is added to manipulate the way the tabs in the EditPanel are rendered (Thanks to the article ‘&lt;a href=&quot;http://labs.episerver.com/en/Blogs/Allan/Dates/2009/1/Neat-Trick-Modifying-Edit-Mode-Tabs/&quot; target=&quot;_blank&quot;&gt;Neat Trick: Modifying Edit Mode Tabs&lt;/a&gt;’ by Allan Thr&#230;n).&lt;/p&gt;
&lt;p&gt;We also need to implement the LoadComplete event of the EditPanel for which we’ve added the new EventHandler in the ‘PlugInDescriptor[] List()’ method. There are three single line calls in the LoadComplete event. First we get the TabStrip object by looking for the ‘actionTab’ control. Secondly we retrieve all properties (the tabs) that are configured for the current page type in our xml configuration file. Finally, we call our Tab Manager that handles the processing of the individual tabs.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; EditPanelLoadComplete(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;// find the TabStrip with id = &amp;quot;actionTab&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     TabStrip actionTabStrip = ControlHelper.FindControl&amp;lt;TabStrip&amp;gt;(sender &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; Control, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;actionTab&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;//get all properties for this pagetype from the config file&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;     List&amp;lt;EPiServerEditPanelManagerPropertyConfigElement&amp;gt; elements =&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;         EditPanelManagerHelper.GetPropertyElementsFromPageTypeConfigElement(CurrentPageTypeConfigElement);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;//call our tab manager&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;     TabStripHelper.SetTabs(actionTabStrip, elements, CurrentPageTypeConfigElement.Active);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Within both the ‘PlugInDescriptor[] List()’ method and the LoadComplete event method there are calls to certain Helper classes. Of course you can set this up any way you like. For this demo I’ve chosen to just simply set up two classes; the EditPanelManagerHelper and the TabStripHelper.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;EditPanelManagerHelper&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The EditPanelManagerHelper is used to retrieve the correct PageTypes and properties from our configuration file. It has two methods. The first method is ‘GetPageTypeNamesFromConfig()’ and reads the xml configuration file for all PageTypes defined using the &lt;em&gt;ConfigurationManager&lt;/em&gt;. The second method is ‘GetPropertyElementsFromPageTypeConfigElement()’ that reads all properties for a given PageType present in the xml configuration file.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; EditPanelManagerHelper&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; List&amp;lt;EPiServerEditPanelManagerPageTypeConfigElement&amp;gt; GetPageTypeNamesFromConfig()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;         List&amp;lt;EPiServerEditPanelManagerPageTypeConfigElement&amp;gt; list = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; List&amp;lt;EPiServerEditPanelManagerPageTypeConfigElement&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;         EPiServerEditPanelManagerConfigSection section = ConfigurationManager.GetSection(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;episervereditpanelmanager&amp;quot;&lt;/span&gt;) &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; EPiServerEditPanelManagerConfigSection;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (section != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;             list.AddRange(section.PageTypes.Cast&amp;lt;EPiServerEditPanelManagerPageTypeConfigElement&amp;gt;());&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; list;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; List&amp;lt;EPiServerEditPanelManagerPropertyConfigElement&amp;gt; GetPropertyElementsFromPageTypeConfigElement(EPiServerEditPanelManagerPageTypeConfigElement ePiServerEditPanelManagerPageTypeConfigElement)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//get element information from pagetype config node&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; ePiServerEditPanelManagerPageTypeConfigElement.Elements.Cast&amp;lt;EPiServerEditPanelManagerPropertyConfigElement&amp;gt;().ToList();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;TabStripHelper&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The second helper class is the TabStripHelper. This contains the actual logic that controls which tabs are displayed and which are hidden.&lt;/p&gt;
&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;
  &lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;readonly&lt;/span&gt; ILog Logger = LogManager.GetLogger(&lt;span style=&quot;color: #0000ff&quot;&gt;typeof&lt;/span&gt;(TabStripHelper));&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SetTabs(TabStrip tabStrip, List&amp;lt;EPiServerEditPanelManagerPropertyConfigElement&amp;gt; elements, &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; activeTab)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (tabStrip == &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; firstVisibleTab = -1;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; activeTabIndex = -1;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; tabStrip.Controls.Count; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;         Tab tab = (Tab)tabStrip.Controls[i];&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum15&quot;&gt;  15:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum16&quot;&gt;  16:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; tabName = tab.Text.ToLower().Trim();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum17&quot;&gt;  17:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum18&quot;&gt;  18:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//get element by tab name&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum19&quot;&gt;  19:&lt;/span&gt;         EPiServerEditPanelManagerPropertyConfigElement element = &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum20&quot;&gt;  20:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (elements != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum21&quot;&gt;  21:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum22&quot;&gt;  22:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum23&quot;&gt;  23:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum24&quot;&gt;  24:&lt;/span&gt;                 IEnumerable&amp;lt;EPiServerEditPanelManagerPropertyConfigElement&amp;gt; list = elements.ToList().Where(x =&amp;gt; x.Name.ToLower().Trim() == tabName);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum25&quot;&gt;  25:&lt;/span&gt;                 &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (list.Any())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum26&quot;&gt;  26:&lt;/span&gt;                 {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum27&quot;&gt;  27:&lt;/span&gt;                     element = list.Single();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum28&quot;&gt;  28:&lt;/span&gt;                 }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum29&quot;&gt;  29:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum30&quot;&gt;  30:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum31&quot;&gt;  31:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum32&quot;&gt;  32:&lt;/span&gt;                 Logger.Debug(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.Format(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;error occured while getting the element for tab &#39;{0}&#39;&amp;quot;&lt;/span&gt;, tabName), ex);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum33&quot;&gt;  33:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum34&quot;&gt;  34:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum35&quot;&gt;  35:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (element != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum36&quot;&gt;  36:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum37&quot;&gt;  37:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(element.IgnoreRoles))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum38&quot;&gt;  38:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum39&quot;&gt;  39:&lt;/span&gt;                 &lt;span style=&quot;color: #008000&quot;&gt;//set visibility&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum40&quot;&gt;  40:&lt;/span&gt;                 tab.Visible = element.Enable;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum41&quot;&gt;  41:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum42&quot;&gt;  42:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum43&quot;&gt;  43:&lt;/span&gt;             {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum44&quot;&gt;  44:&lt;/span&gt;                 &lt;span style=&quot;color: #008000&quot;&gt;//check current user roles&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum45&quot;&gt;  45:&lt;/span&gt;                 tab.Visible = (UserHasRole(element.IgnoreRoles) ? !element.Enable : element.Enable);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum46&quot;&gt;  46:&lt;/span&gt;             }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum47&quot;&gt;  47:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum48&quot;&gt;  48:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum49&quot;&gt;  49:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//store first visible tab index&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum50&quot;&gt;  50:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (tab.Visible &amp;amp;&amp;amp; firstVisibleTab == -1)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum51&quot;&gt;  51:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum52&quot;&gt;  52:&lt;/span&gt;             firstVisibleTab = i;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum53&quot;&gt;  53:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum54&quot;&gt;  54:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum55&quot;&gt;  55:&lt;/span&gt;         &lt;span style=&quot;color: #008000&quot;&gt;//store given active tab index&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum56&quot;&gt;  56:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(activeTab) &amp;amp;&amp;amp; tab.Visible &amp;amp;&amp;amp; tabName == activeTab.ToLower())&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum57&quot;&gt;  57:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum58&quot;&gt;  58:&lt;/span&gt;             activeTabIndex = i;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum59&quot;&gt;  59:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum60&quot;&gt;  60:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum61&quot;&gt;  61:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum62&quot;&gt;  62:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (tabStrip.SelectedTab == 0)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum63&quot;&gt;  63:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum64&quot;&gt;  64:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; set = (activeTabIndex &amp;gt; -1 ? activeTabIndex : firstVisibleTab);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum65&quot;&gt;  65:&lt;/span&gt;         tabStrip.SetSelectedTab(set);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum66&quot;&gt;  66:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum67&quot;&gt;  67:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum68&quot;&gt;  68:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum69&quot;&gt;  69:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; UserHasRole(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; roles)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum70&quot;&gt;  70:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum71&quot;&gt;  71:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;.IsNullOrEmpty(roles))&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum72&quot;&gt;  72:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum73&quot;&gt;  73:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum74&quot;&gt;  74:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum75&quot;&gt;  75:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum76&quot;&gt;  76:&lt;/span&gt;     &lt;span style=&quot;color: #008000&quot;&gt;//get current user roles&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum77&quot;&gt;  77:&lt;/span&gt;     List&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt; currentUserRoleList;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum78&quot;&gt;  78:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum79&quot;&gt;  79:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum80&quot;&gt;  80:&lt;/span&gt;         List&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt; list = EPiServer.Security.PrincipalInfo.Current.RoleList.ToList();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum81&quot;&gt;  81:&lt;/span&gt;         currentUserRoleList = list.ConvertAll(x =&amp;gt; x.ToLower());&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum82&quot;&gt;  82:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum83&quot;&gt;  83:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;catch&lt;/span&gt; (Exception)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum84&quot;&gt;  84:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum85&quot;&gt;  85:&lt;/span&gt;         Logger.Error(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;error occured while handling the current user role list&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum86&quot;&gt;  86:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum87&quot;&gt;  87:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum88&quot;&gt;  88:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum89&quot;&gt;  89:&lt;/span&gt;     List&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt; roleList = roles.Split(&lt;span style=&quot;color: #006080&quot;&gt;&#39;,&#39;&lt;/span&gt;).ToList();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum90&quot;&gt;  90:&lt;/span&gt;     &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; roleList.Any(role =&amp;gt; currentUserRoleList.Contains(role.ToLower().Trim()));&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum91&quot;&gt;  91:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum92&quot;&gt;  92:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This helper class contains two methods. The ‘UserHasRole’ method has been added here for convenience, but you probably have another place for this in your codebase. It simply checks the current users role to the provided userrole list from the ‘ignoreroles’ attribute for the current PageType.&lt;/p&gt;
&lt;p&gt;The first method ‘SetTabs()’ holds three input parameters. The current TabStrip (which holds all tabs of the EditPanel), the list of tabs that you configured in your xml configuration file for the given PageType and the name of the activeTab if present in the xml configuration file. It simply iterates over all controls in the TabStrip and compares these to the xml configuration setup.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And there you have it, that’s all there is to it. As you can see this example shows how to influence the way tabs are rendered within the EditPanel and can possibly simplify the way your site editors experience the Edit Mode of EPiServer. Feel free to comment! &lt;/p&gt;</summary>
    </entry>    <entry>
        <title>ImageVault 4 addon update (v4.1.12)</title>
        <link href="http://blog.imagevault.se/post/49177511775" />
        <id>http://blog.imagevault.se/post/49177511775</id>
        <updated>2013-04-29T13:51:55.0000000Z</updated>
        <summary type="html">&lt;p&gt;We found an issue when using ImageVault 4 with EPiServer CMS 7 and a MVC site. The issue messes up the routing for the links on the site but this has been corrected and a new ImageVault addon version has been released. It will soon be placed at the official episerver feed but for now it resides on the ImageVault nuget feed.&lt;/p&gt;
&lt;p&gt;To update, add the following nuget feed to your site&lt;/p&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://nuget.imagevault.se/nuget/&quot;&gt;http://nuget.imagevault.se/nuget/&lt;/a&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;and then click the Install button on the ImageVault addon v 4.1.12.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;image&quot; src=&quot;http://media.tumblr.com/0b15ed6d4ee49bc556626108366f3ccb/tumblr_inline_mm0rjgBQFu1qz4rgp.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;More on how to add the nuget feed to your episerver configuration can be found in the ImageVault documentation:&#160;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://imagevault.se/en/documentation/api-documentation/?page=installation/manual-installation/episervercms7addon.html&quot;&gt;Manual installation: EPiServer CMS7 ImageVault AddOn&lt;/a&gt;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Getting “Error–&lt;domain user&gt; is not a valid user or group”, when upgrading?</title>
        <link href="http://world.episerver.com/Blogs/Jonas-Lindau/Dates/2013/4/Getting-Errordomain-user-is-not-a-valid-user-or-group-when-upgrading/" />
        <id>http://world.episerver.com/Blogs/Jonas-Lindau/Dates/2013/4/Getting-Errordomain-user-is-not-a-valid-user-or-group-when-upgrading/</id>
        <updated>2013-04-29T09:20:08.0000000Z</updated>
        <summary type="html">&lt;p&gt;I’ve upgraded a lot of sites in my days, but I still run into new errors. Even when you do it the right way, by upgrading the test-environment and collect as much information you can, there is still a chance it won’t work on the production servers. This error was one of those times…&lt;/p&gt;  &lt;p&gt;At first I tried all the obvious things, like check if account was locked, did it have all the correct permissions etc. When all of this was confirmed I really didn’t have much more ideas. But then it hit me! I checked the account in Active Directory once more, and saw that the account name was so long, the “pre-Windows 2000”-name was truncated. For some reason, EPiServer Deployment Center uses this legacy login name during upgrade, and when the name is truncated it won’t work!&lt;/p&gt;  &lt;p&gt;So this is what I did:&lt;/p&gt;  &lt;p&gt;1. After starting Deployment Center and executed the correct upgrade, this error occurred:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/30201/2013/04/29/Capture.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;Capture&quot; border=&quot;0&quot; alt=&quot;Capture&quot; src=&quot;/Globals/xmlrpc/30201/2013/04/29/Capture_thumb.png&quot; width=&quot;562&quot; height=&quot;211&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;2. Check the account in Active Directory to find out the name is truncated:&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/30201/2013/04/29/Capture_2.png&quot;&gt;&lt;img style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px&quot; title=&quot;Capture_2&quot; border=&quot;0&quot; alt=&quot;Capture_2&quot; src=&quot;/Globals/xmlrpc/30201/2013/04/29/Capture_2_thumb.png&quot; width=&quot;569&quot; height=&quot;150&quot; /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;3. Rename the account using a shorter name.&lt;/p&gt;  &lt;p&gt;4. Modify the application-pool so it uses the new username&lt;/p&gt;  &lt;p&gt;5. Run upgrade again.&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Building large scale EPiServer sites</title>
        <link href="http://joelabrahamsson.com/building-large-scale-episerver-sites/" />
        <id>http://joelabrahamsson.com/building-large-scale-episerver-sites/</id>
        <updated>2013-04-29T07:13:03.0000000Z</updated>
        <summary type="html">It has been proven by numerous sites that EPiServer CMS can handle huge amounts of content. Doing so does bring a few challenges though. Here&#39;s a few few patterns that I&#39;ve identified when it comes to building large scale EPiServer sites with great performance.
&lt;p&gt;Last week I received an e-mail with the subject ”Huge number of pages (&amp;gt;500 000) in EPiServer?” As you can imagine the e-mail contained questions related to whether EPiServer CMS can handle sites with A LOT of content.&lt;/p&gt;
&lt;p&gt;It has been proven on a number of occasions that it indeed can. For instance, several of the biggest newspapers in Sweden, with millions of pages, run EPiServer. There are also government sites with several hundreds of thousands of pages.&lt;/p&gt;
&lt;p&gt;That doesn’t mean that we’re not faced with challenges when building large EPiServer sites though.&lt;/p&gt;
&lt;p&gt;In my experience, what those challenges are differs depending on the type of site, or rather, depending on how the content is structured on the site. While an individual site may be a mix of the two, there are two categories of large scale sites in terms of how they structure their content.&lt;/p&gt;
&lt;h3&gt;Content that fit naturally in a deep hierarchy&lt;/h3&gt;
&lt;p&gt;This is common for government sites and the like. Such sites may publish a lot of content that is organized and exposed to visitors in a hierarchy based on topics, subtopic and so on.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/Deep-hierarchy-london.png&quot; alt=&quot;&quot; width=&quot;630&quot; height=&quot;485&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Alternatively the content may fit naturally in a date-based hierarchy, such as an archive with publications.&lt;/p&gt;
&lt;ol&gt; &lt;/ol&gt;
&lt;h3&gt;Content that isn’t hierarchical or the hierarchy is shallow&lt;/h3&gt;
&lt;p&gt;This is very common on media sites such as newspapers. Those sites typically have a shallow hierarchy made up of sections. There may for instance be a first level section called &quot;Sport&quot; and a subsection to that called &quot;Football&quot;.&lt;/p&gt;
&lt;p&gt;An article about one of the Champions League semifinals 2013 is displayed in the context of Sport/Football but beyond that it has no natural place in a tree like structure. On a site with a lot of content this in turn means that an article in context of its place in the hierarchy may have thousands, or even millions, of siblings.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/Shallow-hierarchy-mail-online.png&quot; alt=&quot;&quot; width=&quot;696&quot; height=&quot;665&quot; /&gt;&lt;/p&gt;
&lt;ol&gt; &lt;/ol&gt;
&lt;h2&gt;Finding content based on non-hierarchical criteria&lt;/h2&gt;
&lt;p&gt;Given that we’re dealing with a site that has a lot of content that fit nicely into a tree based structure EPiServer CMS works great out-of-the-box for editors. The CMS stores content in a tree, the content tree, and expose that to editors using UI components such as the Page tree and the Block gadget that also lets editors work with content in a tree.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;While there is&lt;/strong&gt; a lot of content, meaning that the content tree has a lot of branches and leafs editors can easily find the right place to publish new content. They can also find old content simply by navigating the content tree, or the site, the same way a public visitor would.&lt;/p&gt;
&lt;p&gt;In cases where the standard navigation doesn’t suffice, such as when an editor or visitors needs to find content that, in their view, isn’t placed where it should be on the site, basic free text search functionality typically can handle that.&lt;/p&gt;
&lt;p&gt;As for developers building navigation components is typically easy as all they have to do is utilize the page tree. EPiServer&#39;s methods for doing that, such as Get, GetChildren and GetAncestors are highly optimized and aggresively cached with clever dependencies for releasing their caches when needed and only then.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;However, no matter&lt;/strong&gt; how natural the content hierarchy is there are usually a number of requirements for components that lists content in a way that isn’t based on the hierarchy. Examples of such components could for instance be the most recently published pages of a certain type, all articles published be a certain author or department and all publications categorized with a certain keyword.&lt;/p&gt;
&lt;p&gt;For such requirements EPiServer CMS only has the method FindPagesWithCriteria to offer. Besides obvious usability issues for developers FPWC has some serious performance issues, especially on a site with a large volume of content.&lt;/p&gt;
&lt;p&gt;In other words, on a large scale EPiServer site with content fitting naturally into a deep hierarchy we’re faced with the challenge of finding content based on non-hierarchical criteria.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;There are two&lt;/strong&gt; common solutions to this problem. One is to somehow store the answer to such questions at a time where we know that the answer is changing. For instance, this may mean storing a list of the ten last published pages of a given type serialized into a property somewhere or in the Dynamic Data Store, updating each time a page is published. This requires quite a lot of development time and, worse, it requires us to know what questions will need answering beforehand. It’s also rather error prone.&lt;/p&gt;
&lt;p&gt;The second, and much better, common solution to this is to use a search engine. This has been done on a number of large EPiServer sites using different search engines. Today though the obvious solution is to use &lt;a href=&quot;/link/6f0db1b72ffa49968a45c16b1146b95a.aspx?id=43&amp;amp;epslanguage=en&quot;&gt;EPiServer Find&lt;/a&gt;, the search and content retrieval product that EPiServer offers. Find was in many ways built exactly to address this problem in a way that offers great usability for developers and short development time.&lt;/p&gt;
&lt;p class=&quot;conclusion&quot;&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Use a EPiServer Find to create navigations listings of content that are not based on the contents place in the content tree.&lt;/p&gt;
&lt;h2&gt;Non-hierarchical content&lt;/h2&gt;
&lt;p&gt;When the content can’t naturally be fitted into a deep hierarchy additional challenges arise. First, EPiServer’s API and editorial interface is designed for sites organizing content in a tree. If the content can’t be organized into a deep hierarchy performance will suffer. Here’s how I put it in my reply to the e-mail:&lt;/p&gt;
&lt;blockquote&gt;“The content tree can handle millions of items BUT if those items aren&#39;t stored in a deep hierarchy there will be performance problems. That is, if you have a page with ten thousand children you have a problem. If you have a page with a hundred children and each of those have a hundred children you won&#39;t have a problem.”&lt;/blockquote&gt;
&lt;p&gt;While I knew this from experience, after sending that reply, I decided to conduct a few experiments to prove it.&lt;/p&gt;
&lt;p&gt;In the context of a scheduled job I wrote code that created ten thousand pages below the same parent. It also created a hundred pages below another common parent and then a hundred pages below each of those pages. Everything was done in batches of a hundred pages and the mean time for creating a page during each batch was logged.&lt;/p&gt;
&lt;p&gt;Let’s look at the results for creating 100x100 pages in a hierarchy first.&lt;/p&gt;
&lt;table class=&quot;table table-striped table-bordered table-condensed&quot; border=&quot;0&quot;&gt;
&lt;thead&gt; 
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Batch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Avg. time per published page (ms)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt; 
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1-100&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;201-300&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;501-600&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;901-1000&lt;/td&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1901-2000&lt;/td&gt;
&lt;td&gt;24&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4901-5000&lt;/td&gt;
&lt;td&gt;33&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9901-10000&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;There are of course some variances which would likely even themselves out with a larger sample (I ran the test only four times), but it&#39;s pretty clear that it takes almost exactly the same amount of time to create page number ten thousand as page number one when storing pages in a hiearchy where each page has ninetynine siblings.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now, let’s compare that to creating 10000 pages below the same parent.&lt;/p&gt;
&lt;table class=&quot;table table-striped table-bordered table-condensed&quot; border=&quot;0&quot;&gt;
&lt;thead&gt; 
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Batch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Avg. time per published page (ms)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt; 
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1-100&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;201-300&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;501-600&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;901-1000&lt;/td&gt;
&lt;td&gt;50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1901-2000&lt;/td&gt;
&lt;td&gt;83&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4901-5000&lt;/td&gt;
&lt;td&gt;180&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9901-10000&lt;span&gt; &lt;/span&gt;&lt;/td&gt;
&lt;td&gt;414&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;As we can see the time required to publish a page grows based on the number of existing pages below the page’s parent page. Plotted into a diagram we can see that this growth is linear.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/time-growth.png&quot; alt=&quot;&quot; width=&quot;347&quot; height=&quot;208&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Beyond API performance issues, expanding the tree node for a page revealing it’s ten thousand pages in edit mode takes time. Below is what FireBug reported for me when I tried to expand a none with ten thousand children.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/loading-10000-children.png&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;216&quot; /&gt;&lt;/p&gt;
&lt;p&gt;After receiving the response from the server Firefox reported an unresponsive JavaScript on the page and it took several minutes before I actually got to see the pages in the page tree.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Of course, even if it the page tree wouldn&#39;t have any issues with displaying thousands of children for a node such a list would hardly be useful for editors.&lt;/p&gt;
&lt;p class=&quot;conclusion&quot;&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt; EPiServer is built and optimized for sites that stores content in a hierarchy in which each node has hundreds and not thousands of child nodes.&lt;/p&gt;
&lt;p&gt;Clearly, EPiServer&#39;s page tree doesn&#39;t work well for large scale sites with huge volumes of non-hierarchical content. Not in terms of performance and not in terms of editor usability.&lt;/p&gt;
&lt;p&gt;Luckily there&#39;s a fairly easy solution that has proven to work very well. In fact, I&#39;ve seen it done so many times that I&#39;d call it a pattern. What is is? Faking it!&lt;/p&gt;
&lt;h3&gt;Structuring bulk content in arbitrary hierarchies&lt;/h3&gt;
&lt;p&gt;We know that EPiServer needs, or prefers, organizing pages in such a way that each node in its content tree doesn&#39;t have more than hundreds of immediate children. EPiServer does not however care about why a certain page belongs in a certain place in the tree. Therefor we can automatically place pages in a hierarchy based on some arbitrary criteria.&lt;/p&gt;
&lt;p&gt;For articles on a media site this is commonly done by placing them in a structure based on publish date.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/page-tree-date-structure.png&quot; alt=&quot;&quot; width=&quot;394&quot; height=&quot;191&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There are a number of ways to implement such functionality but it typically involves:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Defining a root node for a certain type of content.&lt;/li&gt;
&lt;li&gt;Hooking up to events from EPiServer&#39;s API listening to when content is created.&lt;/li&gt;
&lt;li&gt;When a page of a matching type is created ensure that there is a place for it in the date structure below the root, otherwise create it.&lt;/li&gt;
&lt;li&gt;Move the newly created content to its parent in the date structure.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Of course, when content resides in a structure whose only purpose is to work well with EPiServer performance wise we can&#39;t utilize the content hierarchy when building navigations. The solution to that typically involves four things:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Defining one or&lt;/strong&gt; several properties on the content types that will be used for &quot;bulk content&quot;. These properties are typically of type PageReference, ContentReference or ContentArea. For instance, an article may have a property named Section of type PageReference which points to the Football section.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Utilizing the above&lt;/strong&gt; mentioned property/properties when rendering pages to determine in what context they should be shown. For instance, an article about a Champions League game may have a Section property pointing to a page named Football which in turn is a child of a page named Sport. Based on that the article&#39;s content is displayed framed by a header, navigation elements and right column from Football or Sport.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Using a search&lt;/strong&gt; engine to create listings. Essentially I&#39;m talking about the same problem as we looked at before here, finding content based on non-hierarchical criteria. The only difference is that we now need to apply the same solution in more places as the majority of the content of the site&#39;s content is organized in such a way in the content tree that it can&#39;t be used to build navigations and listings. &lt;br /&gt;&lt;strong&gt;With that said&lt;/strong&gt;, we can still utilize EPiServer&#39;s standard API methods for components such as the main navigation as those pages aren&#39;t the &quot;bulk content&quot; and therefor works well with the page tree. Again while we can use pretty much any search engine that offers good performance and scalability, EPiServer Find is the best option as it was born out of these specific needs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Rewriting URLs.&lt;/strong&gt; By default URLs on an EPiServer site is built up using the page&#39;s name prefixed by the name of each of its ancestors in the page tree. When storing articles or other content in a structure that has nothing to do with how visitors sees the page on the site URLs won&#39;t seem very logical. For instance an URL like /2013/04/23/champions-league.. is hardly helpful and doesn&#39;t look very good. With older versions of EPiServer CMS we typically handled that using a custom URL rewriter. Nowadays with EPiServer 7 we do it using &lt;a href=&quot;/link/e9ec501e09a64e74bdad2df4f1102ae4.aspx?id=526&amp;amp;epslanguage=en&quot;&gt;custom routing&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=&quot;conclusion&quot;&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Automatically organize non-hierarchical content in arbitrary hierarchies based on creation date, first letter in their names or some other criteria. Use properties on the content to tie it to pages in the page tree which provide the context in which the content should be rendered. Use EPiServer Find to build listings.&lt;/p&gt;
&lt;p&gt;Using the above approach we solve the performance issues when dealing with non-hierarchical content of the type that is often found on media sites, blogs and the like. While that works great we have one more problem to solve - how editors create and find the content for which the page tree is more or less useless.&lt;/p&gt;
&lt;h3&gt;Custom components for editorial workflows&lt;/h3&gt;
&lt;p&gt;We could tell editors &quot;To create a new article click on the Articles node in the page tree. We have some code that will automatically move it a few levels down in a date based structure. Oh, and don&#39;t forget to set the Section property.&quot; However, odds are we wouldn&#39;t find much jobs afterwards and we&#39;d see buch of angry comments about EPiServer on Twitter.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Clearly, if we&#39;re&lt;/strong&gt; dealing with the type of site that the page tree doesn&#39;t work well with we can&#39;t just be content with solving performance issues. We&#39;ll also need to extend EPiServer&#39;s edit mode to provide good workflows for editors.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Exactly how such components should work and be implemented differs from site to site but it typically involves functionality to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create &quot;bulk content&quot; without having to use the page tree gadget.&lt;/li&gt;
&lt;li&gt;Either automatically populating &quot;infrastructure properties&quot; such as Section or making it very easy for editors to do so.&lt;/li&gt;
&lt;li&gt;List the most recent content. Especially on media sites it&#39;s a very common requirement to have a list that displays all articles that have either been published today, not yet been published or is scheduled to be published.&lt;/li&gt;
&lt;li&gt;Find content based on criteria such as author, publish date and section.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&#39;ve built such functionality both in EPiServer 6 and EPiServer 7 and based on those experiences I&#39;ve created the &lt;a href=&quot;/link/c307dee82d384e9cbfa436f08a8b949d.aspx?id=509&amp;amp;epslanguage=en&quot;&gt;PowerSlice&lt;/a&gt; project. PowerSlice is one way of addressing several of the above requirements and may solve all needs for some sites. For other sites it may be used for inspiration.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail thumbnail-centered&quot; src=&quot;/PageFiles/643/creating-content-in-slice.png&quot; alt=&quot;&quot; width=&quot;377&quot; height=&quot;152&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Either way, it&#39;s&lt;/strong&gt; very much possible to build the components needed by editors. With EPiServer 7 it typically involves creating custom Dojo/Dijit widgets and utilizing EPiServer Find.&lt;/p&gt;
&lt;p class=&quot;conclusion&quot;&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Extend EPiServer&#39;s edit mode with custom components tailor made for the needs of the editors. PowerSlice may be an option and/or used for inspiration.&lt;/p&gt;
&lt;p&gt;Are you still with me? Perhaps it&#39;s about time we looked at an example.&lt;/p&gt;
&lt;h2&gt;An example - this site&lt;/h2&gt;
&lt;p&gt;While this site doesn&#39;t exactly fit the &quot;large scale&quot; description as it&#39;s primarily a blog it, along with certain parts of many other &quot;small&quot; sites, does have non-hierarchical content. Therefor I applied the above mentioned techniques to it, meaning that we can look at it as an example of how a large scale site, such as a media site, can be built.&lt;/p&gt;
&lt;h3&gt;Organizing pages&lt;/h3&gt;
&lt;p&gt;In terms of hiearchy there are two types of pages on the site. Articles and tags are automatically organized in two separate structures. Sections and standard pages are not.&lt;/p&gt;
&lt;p&gt;All articles resider under a node below the start page. Under that node they are grouped first by year and then by month.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/example-page-tree.png&quot; alt=&quot;&quot; width=&quot;258&quot; height=&quot;516&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Articles have a property named MainCategory edited using a drop down from which it&#39;s possible to select one of the categories (sections) on the site.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/example-category-property.png&quot; alt=&quot;&quot; width=&quot;228&quot; height=&quot;40&quot; /&gt;&lt;/p&gt;
&lt;p&gt;This property is used for breadcrumbs and context specific things when rendering an article.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/Example-MainCategory-usage.png&quot; alt=&quot;&quot; width=&quot;448&quot; height=&quot;77&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Articles also have a content area property to which other categories can be added.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/example-additional-categories-property.png&quot; alt=&quot;&quot; width=&quot;590&quot; height=&quot;92&quot; /&gt;&lt;/p&gt;
&lt;p&gt;MainCategory and any categories added to AdditionalCategories are combined by a code only property on articles named AllCategories.&lt;/p&gt;
&lt;p&gt;New articles can be created using a UI component that&#39;s created using PowerSlice.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/643/Example-create-new-article.png&quot; alt=&quot;&quot; width=&quot;477&quot; height=&quot;273&quot; /&gt;&lt;/p&gt;
&lt;p&gt;When an article is created it&#39;s initial parent is the root node for articles. Using a modified version of my old open source project &lt;a href=&quot;https://github.com/joelabrahamsson/PageStructureBuilder&quot;&gt;PageStructureBuilder&lt;/a&gt; the article as automatically moved to a year/month structure.&lt;/p&gt;
&lt;h3&gt;Listings and routing&lt;/h3&gt;
&lt;p&gt;Categories/sections list articles &quot;belonging&quot; to them based ordered by publication date. This is done using a fairly simple search query using EPiServer Find that filters on article&#39;s AllCategories property.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;_searchClient.Search()
    .Filter(page =&amp;gt; page.Categories.Match(currentPage.ContentLink))
    .CurrentlyPublished()   
    .FilterOnReadAccess()
    .OrderByDescending(x =&amp;gt; x.StartPublish);&lt;/pre&gt;
&lt;p&gt;As for URLs I use a custom partial router, which I&#39;ve &lt;a href=&quot;/link/e9ec501e09a64e74bdad2df4f1102ae4.aspx?id=526&amp;amp;epslanguage=en&quot;&gt;previously described in great detail&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Dealing with traffic&lt;/h2&gt;
&lt;p&gt;So far this article has been about how to build sites with large volumes of content on EPiServer CMS. There&#39;s of course another way to interpret &quot;large scale sites&quot; - sites with a lot of traffic.&lt;/p&gt;
&lt;p&gt;Again, it&#39;s already been proven by a number of existing EPiServer customers that EPiServer can handle huge volumes of traffic. With that said, it&#39;s of course also very much possible to build a site on EPiServer that crumbles once it&#39;s hit with more than a couple of concurrent requests.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A robust EPiServer&lt;/strong&gt; site that can handle a lot of traffic and let editors work efficiently at the same time requires a good implementation. And a good implementation requires skilled and experienced developers who know what they are doing.&lt;/p&gt;
&lt;p&gt;In general EPiServer CMS&#39;s API is highly optimized and the most significant methods for getting content based on the hierarchy are cached. As for EPiServer Find it&#39;s fast, highly scalable and also has mechanisms for caching that can be used when needed. So, as first step in hardening a site for production it&#39;s absolutely vital to use the API methods visely. Having done so the site will hold well on its own.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sometimes though, &lt;/strong&gt;we&#39;re dealing with a site that has so much traffic that it&#39;s not just enough use caching to prevent database calls. The actual rendered HTML output needs to be cached as well. For that EPiServer offers a fairly basic &lt;a href=&quot;/link/cc5f6e31902d4913b22a2f7c573bbde7.aspx?id=184&amp;amp;epslanguage=en&quot;&gt;output cache&lt;/a&gt; that can be used.&lt;/p&gt;
&lt;p&gt;While that may be an option, for site with really, really, really much traffic we may need even more efficient output caching. In those cases we can either construct a custom output cache to use on the webservers or, which I prefer, use a web content accelerator/caching reverse proxy such as Varnish. We may also want to look in to using a CDN instead or as a compliment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;One thing to&lt;/strong&gt; beware of though is that any form of output caching, with the exception of partial caching, will limit editors ability to use some of the functionality built into the CMS such as personalization. If that&#39;s a problem we can often work around that by loading parts of pages using JavaScript and not caching such requests. Of course that means more requests to the site though.&lt;/p&gt;
&lt;p&gt;In general, my philosophy is to build the site as robust and performant as possible without so that it can handle the traffic without any other form of caching. After that, if it&#39;s needed or economically motivated some sort of cache can be put in front of the site.&lt;/p&gt;
&lt;p&gt;This approach has two benefits. First of all we can choose to use output caching for the right reasons. Second, using output caching tends to hide performance problems in the application and while those may not be a problem at first they may be whenever the cache is released or if there&#39;s an issue with the output cache. Then it&#39;s very valuable if the web applciation can hold on its own.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;ul class=&quot;check&quot;&gt;
&lt;li&gt;EPiServer CMS can handle sites with millions of pages.&lt;/li&gt;
&lt;li&gt;For large scale sites FindPagesWithCriteria doesn&#39;t work for non-hierarchical queries. Use EPiServer Find for that.&lt;/li&gt;
&lt;li&gt;EPiServer relies on content being split up into a hierarchy. If the content doesn&#39;t fit naturally into such a hiearchy, make one up and use a combination of properties, Find and edit mode extensions create new content and build listings.&lt;/li&gt;
&lt;/ul&gt;
</summary>
    </entry>    <entry>
        <title>Creating a Link to a Page in your EPiServer 7 MVC View</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/28/creating-a-link-to-a-page-in-your-episerver-7-mvc-view" />
        <id>http://cjsharp1.github.io/blog/2013/04/28/creating-a-link-to-a-page-in-your-episerver-7-mvc-view</id>
        <updated>2013-04-29T04:00:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;When developing an EPiServer 7 site (or really any site, for that matter), making a link to a page is one of the most common things you&#39;ll do. So, I thought I&#39;d do something a little more basic and explore how to handle this task in your front-end page and block templates, specifically using MVC Razor views. In this post, we&#39;ll look at what you can currently use to create a link to a page, then I&#39;ll introduce some extension methods that you can use to give yourself a little more flexibility in your MVC view.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;Current Options and Limitations&lt;/h2&gt;

&lt;p&gt;First of all, resist the temptation to solely rely on the &lt;code&gt;LinkURL&lt;/code&gt; property in the &lt;code&gt;PageData&lt;/code&gt; object. This will return an internal link to the page that isn&#39;t very user friendly. Sure, when you click the link it takes you to the correct page, but we don&#39;t want to be showing these links to the outside world. Instead, rely on the helpers and extensions that EPiServer 7 provides.&lt;/p&gt;

&lt;h3&gt;Html.PageLink&lt;/h3&gt;

&lt;p&gt;The simplest and most common way to create a link to page is to use EPiServer&#39;s &lt;code&gt;Html.PageLink&lt;/code&gt; helper. Using this helper, you can pass in a &lt;code&gt;PageData&lt;/code&gt; object, a &lt;code&gt;PageReference&lt;/code&gt;, or even a &lt;code&gt;LinkItem&lt;/code&gt;, and it will create an HTML anchor, using the clean, friendly URL to the page. For the text of the link, if you do not supply it with a text string, it will use the &lt;code&gt;PageName&lt;/code&gt; property for the page (or the &lt;code&gt;Text&lt;/code&gt; property for a &lt;code&gt;LinkItem&lt;/code&gt; object).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;@Html.PageLink(Model.SomePageReference)
@Html.PageLink(Model.SomePageData)
@Html.PageLink(&quot;A link to a page&quot;, Model.SomeLinkItem)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can also pass in route data information that can change the URL (helpful when working with language branches) or additional HTML attributes to add to the anchor tag.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;@Html.PageLink(&quot;A link to a Swedish page&quot;, Model.SomePageReference, new { language = &quot;sv-SE&quot; }, null)
@Html.PageLink(&quot;A link with a class&quot;, Model.SomePageReference, null, new { @class = &quot;link-class&quot; })
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Be sure to check &lt;a href=&quot;http://world.episerver.com/Documentation/Class-library/?documentId=cms/7/95e55ffc-6ea1-f864-ce31-ceee26ee9b0a&quot;&gt;the SDK for this helper&lt;/a&gt;, because there are a lot more options you could use that might be a better fit for your needs.&lt;/p&gt;

&lt;p&gt;In most cases, this HTML helper is what you&#39;ll use to create a link to a page. There are some situations, however, where you&#39;ll need a little more flexibility. A common example is when you want to wrap an image tag with an anchor tag, or when you want to wrap more elements. To solve that situation, you could build an image link HTML helper, or you could just retrieve the actual URL to the page using &lt;code&gt;Url.PageUrl&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;Url.PageUrl&lt;/h3&gt;

&lt;p&gt;Another way is to use EPiServer&#39;s &lt;code&gt;Url.PageUrl&lt;/code&gt; helper. This helper only takes one parameter: the internal URL for the page. It will then use EPiServer&#39;s &lt;code&gt;PermanentLinkUtility&lt;/code&gt; to find the friendly URL to the page, and return only the URL as a string. You could then take that string and use it directly in an HTML anchor tag.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;@Url.PageUrl(Model.SomePageData.LinkURL)&quot;&amp;gt;
    A link to a page
&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This covers a lot of the other cases when you need better flexibility when creating a link to a page. The only thing I don&#39;t like about this, though, is that you need to have the &lt;code&gt;PageData&lt;/code&gt; of the page to use it. So if you have a &lt;code&gt;PageReference&lt;/code&gt; property on your page or block type, you&#39;ll need to use &lt;code&gt;IContentLoader&lt;/code&gt; or &lt;code&gt;IContentRepository&lt;/code&gt; to get the &lt;code&gt;PageData&lt;/code&gt; from the &lt;code&gt;PageReference&lt;/code&gt;. Wouldn&#39;t it be easier to just pass in a &lt;code&gt;PageData&lt;/code&gt; or a &lt;code&gt;PageReference&lt;/code&gt; object instead?&lt;/p&gt;

&lt;h2&gt;Another Option: Extending the UrlHelper&lt;/h2&gt;

&lt;p&gt;The solution I put together, which I think provides the best of both worlds, is &lt;em&gt;heavily&lt;/em&gt; based on the code for EPiServer&#39;s &lt;code&gt;Html.PageLink&lt;/code&gt; helper. It only returns the friendly URL to a page like &lt;code&gt;Url.PageUrl&lt;/code&gt;, but still gives you the flexibility to pass in a &lt;code&gt;PageData&lt;/code&gt; or a &lt;code&gt;PageReference&lt;/code&gt; object like &lt;code&gt;Html.PageLink&lt;/code&gt;. Rather than extending &lt;code&gt;HtmlHelper&lt;/code&gt;, it extends &lt;code&gt;UrlHelper&lt;/code&gt; and works alongside of the &lt;code&gt;Url.PageUrl&lt;/code&gt; helper.&lt;/p&gt;

&lt;h3&gt;UrlExtensions.cs&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;public static class UrlExtensions
{
    public static string PageUrl(this UrlHelper urlHelper, PageReference pageLink)
    {
        return UrlExtensions.PageUrl(urlHelper, pageLink, (object)null, (IContentRepository)null);
    }

    public static string PageUrl(this UrlHelper urlHelper, PageReference pageLink, object routeValues)
    {
        return UrlExtensions.PageUrl(urlHelper, pageLink, routeValues, (IContentRepository)null);
    }

    public static string PageUrl(this UrlHelper urlHelper, PageData page)
    {
        return UrlExtensions.PageUrl(urlHelper, page, (object)null);
    }

    public static string PageUrl(this UrlHelper urlHelper, PageData page, object routeValues)
    {
        if (!PageDataExtensions.HasTemplate(page))
            return string.Empty;

        switch (page.LinkType)
        {
            case PageShortcutType.Normal:
            case PageShortcutType.Shortcut:
            case PageShortcutType.FetchData:
                return UrlExtensions.PageUrl(urlHelper, page.PageLink, routeValues, (IContentLoader)null, (IPermanentLinkMapper)null, (LanguageSelectorFactory)null);

            case PageShortcutType.External:
                return page.LinkURL;

            case PageShortcutType.Inactive:
                return string.Empty;

            default:
                return string.Empty;
        }
    }

    private static string PageUrl(this UrlHelper urlHelper, PageReference pageLink, object routeValues, IContentRepository contentRepository)
    {
        if (contentRepository == null)
            contentRepository = ServiceLocator.Current.GetInstance&amp;lt;IContentRepository&amp;gt;();
        if (PageReference.IsNullOrEmpty(pageLink))
            return string.Empty;
        PageData page = contentRepository.Get&amp;lt;PageData&amp;gt;((ContentReference)pageLink);
        return UrlExtensions.PageUrl(urlHelper, page, routeValues);
    }

    private static string PageUrl(this UrlHelper urlHelper, PageReference pageLink, object routeValues, IContentLoader contentQueryable, IPermanentLinkMapper permanentLinkMapper, LanguageSelectorFactory languageSelectorFactory)
    {
        RouteValueDictionary routeValueDictionary = new RouteValueDictionary(routeValues);
        if (!routeValueDictionary.ContainsKey(RoutingConstants.LanguageKey))
            routeValueDictionary[RoutingConstants.LanguageKey] = (object)ContentLanguage.PreferredCulture.Name;
        if (!routeValueDictionary.ContainsKey(RoutingConstants.ActionKey))
            routeValueDictionary[RoutingConstants.ActionKey] = (object)&quot;index&quot;;
        routeValueDictionary[RoutingConstants.NodeKey] = (object)pageLink;
        UrlExtensions.SetAdditionalContextValuesForContent(urlHelper, pageLink, routeValueDictionary, contentQueryable, permanentLinkMapper, languageSelectorFactory);
        return urlHelper.Action((string)null, routeValueDictionary);
    }

    private static void SetAdditionalContextValuesForContent(this UrlHelper urlHelper, PageReference pageLink, RouteValueDictionary values, IContentLoader contentQueryable, IPermanentLinkMapper permanentLinkMapper, LanguageSelectorFactory languageSelectorFactory)
    {
        bool IdKeep = HttpContext.Current.Request.QueryString[&quot;idkeep&quot;] != null;
        contentQueryable = contentQueryable ?? ServiceLocator.Current.GetInstance&amp;lt;IContentLoader&amp;gt;();
        permanentLinkMapper = permanentLinkMapper ?? ServiceLocator.Current.GetInstance&amp;lt;IPermanentLinkMapper&amp;gt;();
        languageSelectorFactory = languageSelectorFactory ?? ServiceLocator.Current.GetInstance&amp;lt;LanguageSelectorFactory&amp;gt;();
        IContent content = contentQueryable.Get&amp;lt;IContent&amp;gt;(pageLink, languageSelectorFactory.Fallback(values[RoutingConstants.LanguageKey] as string ?? ContentLanguage.PreferredCulture.Name, true));
        if (content == null)
            return;
        if (IdKeep)
            values[&quot;id&quot;] = (object)content.ContentLink.ToString();
        UrlExtensions.SetAdditionalContextValuesForPage(values, IdKeep, content);
    }

    private static void SetAdditionalContextValuesForPage(RouteValueDictionary values, bool IdKeep, IContent content)
    {
        PageData pageData = content as PageData;
        if (pageData == null)
            return;
        if (pageData.LinkType == PageShortcutType.Shortcut)
        {
            PropertyPageReference propertyPageReference = pageData.Property[&quot;PageShortcutLink&quot;] as PropertyPageReference;
            if (propertyPageReference != null &amp;amp;&amp;amp; !PageReference.IsNullOrEmpty(propertyPageReference.PageLink))
            {
                values[RoutingConstants.NodeKey] = (object)propertyPageReference.PageLink;
                if (IdKeep)
                    values[&quot;id&quot;] = (object)((object)propertyPageReference).ToString();
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;At this point, I&#39;m just supporting passing in &lt;code&gt;PageData&lt;/code&gt; and &lt;code&gt;PageReference&lt;/code&gt; objects, but it could easily be extended to support the other objects that &lt;code&gt;Html.PageLink&lt;/code&gt; supports. I also made it support additional route data information, which will help when creating links to pages in another language branch.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;@Url.PageUrl(Model.SomePageReference, new { language = &quot;sv-SE&quot; })&quot;&amp;gt;
    &amp;lt;img src=&quot;swedish_flag.png&quot; /&amp;gt;
&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I hope you find this useful, and that it gives you the most flexibility you need when creating a link to a page in your EPiServer site!&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>CMS 7 Subscriptions “bug”</title>
        <link href="http://world.episerver.com/Blogs/Per-Nergard/Dates/2013/4/CMS-7-Subscriptions-bug/" />
        <id>http://world.episerver.com/Blogs/Per-Nergard/Dates/2013/4/CMS-7-Subscriptions-bug/</id>
        <updated>2013-04-26T10:56:13.0000000Z</updated>
        <summary type="html">&lt;p&gt;The other day the first task was to build a subscription page. The Alloy demo templates doesn’t contain an example so I needed a quick brushing up on the topic.&lt;/p&gt;  &lt;p&gt;The conclusion is that subscriptions work in the same way as in older versions of EPiServer. Not an extremely well documented area but that might be the topic of another post.&lt;/p&gt;  &lt;p&gt;So our subscription template needs a property named “EPSUBSCRIBE-ROOT”. &lt;/p&gt;  &lt;p&gt;So now the problems begins. In C# we can’t use a hyphen (-) in class or property names. We have the same issue with the property&amp;#160; “EPSUBSCRIBE-EXCLUDE” that is optional to include on pages that should not be sent out in the subscription job.&lt;/p&gt;  &lt;p&gt;EPiServer has created a bug for this issue.&lt;/p&gt;  &lt;p&gt;To get around this until EPiServer has released a fix we have to create the properties through admin mode.&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>EpiServer CMS 6 Useful SQL Queries</title>
        <link href="http://world.episerver.com/Blogs/K-Khan-/Dates/2013/4/EpiServer-CMS-6-Useful-SQL-Queries/" />
        <id>http://world.episerver.com/Blogs/K-Khan-/Dates/2013/4/EpiServer-CMS-6-Useful-SQL-Queries/</id>
        <updated>2013-04-25T13:28:16.0000000Z</updated>
        <summary type="html">&lt;p&gt;Here is a set of few useful queries that we have been using since CMS 5 internally for debugging and improving customer experience. I have not tested these with CMS 7.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;List All Web Pages with Their Properties and Current Values     &lt;br /&gt;&lt;/strong&gt;    &lt;br /&gt;Below Query can help web editors to audit their contents.&lt;/p&gt;  &lt;p&gt;select distinct tblPageLanguage.LinkURL &#39;Web Page URL&#39;, tblPageLanguage.Name &#39;Web Page Name&#39;,tblPageDefinition.Name   &lt;br /&gt;&#39;Property Name&#39;, &#39;Property Value&#39; =    &lt;br /&gt;case    &lt;br /&gt;when tblProperty.Number is null and tblProperty.FloatNumber is null and    &lt;br /&gt;tblProperty.PageType is null and tblProperty.PageLink is null and tblProperty.Date is null and    &lt;br /&gt;tblProperty.String is null and tblProperty.LongString is null    &lt;br /&gt;then &#39;Boolean: &#39; + cast( tblProperty.Boolean as varchar( 40 ) )    &lt;br /&gt;when tblProperty.Number is not null then &#39;Number: &#39;+ cast( tblProperty.Number as varchar( 40 ) )    &lt;br /&gt;when tblProperty.FloatNumber is not null then &#39;FloatNumber: &#39;+ cast( tblProperty.FloatNumber as    &lt;br /&gt;varchar( 40 ) )    &lt;br /&gt;when tblProperty.PageType is not null then &#39;PageType: &#39;+ cast( tblProperty.PageType as    &lt;br /&gt;varchar(40))    &lt;br /&gt;when tblProperty.PageLink is not null then &#39;PageLink: &#39;+ cast( tblProperty.PageLink as    &lt;br /&gt;varchar( 40 ) )    &lt;br /&gt;when tblProperty.Date is not null then &#39;Date: &#39;+ cast( tblProperty.Date as varchar( 40 ) )    &lt;br /&gt;when tblProperty.String is not null then &#39;String: &#39;+ cast( tblProperty.String as varchar( 40 ) )    &lt;br /&gt;when tblProperty.LongString is not null then &#39;LongString: &#39;+ cast( tblProperty.LongString as    &lt;br /&gt;varchar( 40 ) )    &lt;br /&gt;else cast( &#39;Error Determining Value!&#39; as varchar( 40 ) )    &lt;br /&gt;end    &lt;br /&gt;from tblProperty     &lt;br /&gt;inner join tblPage on tblProperty.fkPageID = tblPage.pkID     &lt;br /&gt;inner join tblPageDefinition on tblProperty.fkPageDefinitionID = tblPageDefinition.pkID    &lt;br /&gt;inner join tblPageLanguage on tblpage.pkID = tblPageLanguage.fkPageID    &lt;br /&gt;order by tblPageLanguage.LinkURL, tblPageLanguage.Name, tblPageDefinition.Name&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SQL Query to List All User Tables and Their Columns In a SQL Server Database&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;select sysobjects.Name, syscolumns.Name   &lt;br /&gt;from sysobjects inner join syscolumns on sysobjects.id = syscolumns.id    &lt;br /&gt;where sysobjects.xtype = &#39;U&#39;    &lt;br /&gt;order by sysobjects.Name, syscolumns.colorder&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SQL Server Procedure to Display the Web Page Hierarchy&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;It can help us to investigate large tree structures&lt;/p&gt;  &lt;p&gt;IF EXISTS (SELECT name FROM sysobjects   &lt;br /&gt;WHERE name = &#39;ShowHierarchy&#39; AND type = &#39;P&#39;)    &lt;br /&gt;DROP PROCEDURE ShowHierarchy    &lt;br /&gt;go    &lt;br /&gt;CREATE PROC dbo.ShowHierarchy ( @Root int ) AS BEGIN    &lt;br /&gt;SET NOCOUNT ON    &lt;br /&gt;DECLARE @PageID int, @PageName varchar(30)    &lt;br /&gt;SET @PageName = (SELECT tblPageLanguage.Name FROM dbo.tblPage inner join tblPageLanguage on tblpage.pkID = tblPageLanguage.fkPageID WHERE pkID = @Root)    &lt;br /&gt;PRINT REPLICATE( &#39;-&#39;, @@NESTLEVEL * 4) + @PageName    &lt;br /&gt;SET @PageID = (SELECT MIN( pkID ) FROM dbo.tblPage WHERE fkParentID = @Root)    &lt;br /&gt;WHILE @PageID IS NOT NULL    &lt;br /&gt;BEGIN    &lt;br /&gt;EXEC dbo.ShowHierarchy @PageID    &lt;br /&gt;SET @PageID = (SELECT MIN( pkID ) FROM dbo.tblPage    &lt;br /&gt;WHERE fkParentID = @Root AND pkID &amp;gt; @PageID)    &lt;br /&gt;END    &lt;br /&gt;END    &lt;br /&gt;go    &lt;br /&gt;ShowHierarchy 1    &lt;br /&gt;go&lt;/p&gt;  &lt;p&gt;OUTPUT will be something like&lt;/p&gt;  &lt;p&gt;--------Home   &lt;br /&gt;------------Browse catalogue    &lt;br /&gt;----------------Publications    &lt;br /&gt;--------------------Carousel    &lt;br /&gt;------------------------Publications Banner 1    &lt;br /&gt;------------------------Publications Banner 2    &lt;br /&gt;------------------------Publications Banner 3    &lt;br /&gt;------------------------Publications Banner 4    &lt;br /&gt;--------------------Featured Products    &lt;br /&gt;------------------------Product 3    &lt;br /&gt;------------------------Product 2    &lt;br /&gt;------------------------Product 1    &lt;br /&gt;--------------------Most Popular Products&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;List All Page Types and Their Properties&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;We used below query to make Properties Labels more readable for web editors.&lt;/p&gt;  &lt;p&gt;select tblPageType.Name &#39;Page Type Name&#39;, tblPageType.Description &#39;Page Type Description&#39;,   &lt;br /&gt;tblPageType.FileName &#39;Page Template File&#39;, tblPageDefinition.Name &#39;Property Name&#39;,    &lt;br /&gt;tblPageDefinition.EditCaption &#39;Edit Heading&#39;, tblPageDefinition.HelpText &#39;Help Text&#39;    &lt;br /&gt;from tblPageType inner join tblPageDefinition    &lt;br /&gt;on tblPageType.pkID = tblPageDefinition.fkPageTypeID    &lt;br /&gt;order by tblPageType.Name, tblPageDefinition.FieldOrder&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;strong&gt;List All Page Template Files, Page Types and Web Pages&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;select distinct tblPageType.FileName &#39;Page Template File&#39;, tblPageType.Name &#39;Page Type Name&#39;,   &lt;br /&gt;tblPageType.Description &#39;Page Type Description&#39;, tblPageLanguage.Name &#39;Web Page Name&#39;,    &lt;br /&gt;tblPageLanguage.LinkURL &#39;Web Page URL&#39;    &lt;br /&gt;from tblPageType    &lt;br /&gt;inner join tblPage on tblPageType.pkID = tblPage.fkPageTypeID    &lt;br /&gt;inner join tblPageLanguage on tblPage.pkID = tblPageLanguage.fkPageID    &lt;br /&gt;order by tblPageLanguage.Name&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;List All Defined Page Types&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;select Name, Filename from tblPageType   &lt;br /&gt;order by Name&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>EPiServer.ImageMap revisited</title>
        <link href="http://www.tech-fellow.lv/?p=6272" />
        <id>http://www.tech-fellow.lv/?p=6272</id>
        <updated>2013-04-23T13:05:10.0000000Z</updated>
        <summary type="html">If somebody is using some legacy technologies like image maps then probably there are good news that EPiServer.ImageMap editor plugin has been revisited to make it work with EPiServer 7. &amp;#160; Installation There are few steps that you need to take in order to make plugin available for editors: 1. Download latest source from (need &lt;span class=&quot;ellipsis&quot;&gt;&amp;#8230;&lt;/span&gt; &lt;span class=&quot;more-link-wrap&quot;&gt;&lt;a href=&quot;http://www.tech-fellow.lv/2013/04/episerver-imagemap-revisited/&quot; class=&quot;more-link&quot;&gt;&lt;span&gt;Read More ...&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;</summary>
    </entry>    <entry>
        <title>On-page editing and forms editing stop working in EPiServer 7</title>
        <link href="http://shahinalborz.se/?p=638" />
        <id>http://shahinalborz.se/?p=638</id>
        <updated>2013-04-23T11:58:42.0000000Z</updated>
        <summary type="html">Working in EpiServer 7 we discovered that some pages, without any obvious reason, were suddenly not editable anymore. Navigating in edit mode, the particular pages did not get the onpage edit borders and clicking the forms editing button would just make the ajax loader keep going forever. No errors in the logfile either. After some [...]</summary>
    </entry>    <entry>
        <title>Set up a user friendly Edit Mode before the training</title>
        <link href="http://world.episerver.com/Blogs/Maria-Sognefors/Dates/2013/4/Set-up-a-user-friendly-Edit-Mode-before-the-training/" />
        <id>http://world.episerver.com/Blogs/Maria-Sognefors/Dates/2013/4/Set-up-a-user-friendly-Edit-Mode-before-the-training/</id>
        <updated>2013-04-23T11:48:52.0000000Z</updated>
        <summary type="html">&lt;p&gt;   &lt;p&gt;&lt;strong&gt;EPiServer is, as you probably already know a very flexible system. There is plenty to do to adapt the tool for both visitors and editors. I am so often surprised with that so few do anything about the editor interface.&lt;/strong&gt;&lt;/p&gt;     &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;a href=&quot;http://www.7minds.se/blogg/2013/4/anvandarvanlighet-i-episerver/&quot;&gt;This blog post is translated with Google Translate. Read the post in Swedish here&lt;/a&gt;&lt;/p&gt;     &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;I think one reason is that it is so easy to change so that nobody does. The developers do not see it as a problem that there are fields with strange names or tabs that can not benefit from. It does not matter that there are many folders in File Manager, for they are, after all, not be used. But from my perspective, one can not be more wrong. It is exactly this that matters. &lt;/p&gt;     &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;A person who has never seen EPiServer has no idea that these things are easy to change and think it must be so. The field where an editor to write his text named Main Body does not think it is logical for that to which to write their body. This creates two problems, and the risk is that the person think that the system is not user friendly and boring. The second problem is that it makes it unnecessarily difficult for a person to learn the system.&lt;/p&gt;     &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;My advice to you is that already in the requirement specifications of the website to ensure that all names and field right from the start. There is no reason to delay it. I get so often hear, that we take it later. The problem is that &amp;quot;later&amp;quot; rarely comes. It is simply not done. Even if you do not do it right so it MUST be done before the training of editors. It is often when the editors meet the system the first time and you know how they say, &lt;strong&gt;FIRST IMPRESSION LAST&lt;/strong&gt;. &lt;/p&gt;     &lt;/p&gt;  &lt;p&gt;   &lt;p&gt;To simplify for you as a specifier / clients I have made a list of things that need to be examined in EPiServer before training so that editor mode is as easy as possible to learn and understand. If you do not know how things should be done, bring the list to your provider and go through it together. Most of the points concerning EPiServer 6 and earlier, but it&#39;s good to go through the list even for EPiServer 7. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Name and help texts on field&lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;All fields in templates may have their own names and help texts. These are often quite technical names and help texts are often lacking. There should be good clear name that makes it easy to understand what each field should contain. This can be done in XML files, so that it is possible to have the editor interface in multiple languages, if desired. Making decisions about which language you should have prior training. Change preferably not on the default name from EPiServer, then this will affect the user documentation to come. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Order in the field &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;Put the fields in a logical order, so that it becomes easy to fill a page with content. Determine if certain fields should be mandatory or not. Also make sure that it is logical to understand why some fields located on a particular tab. Generally speaking, it may be appropriate to place fields such as page is built, top down simply. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Flaps position, name and any permissions &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;Determine the order in which tabs to show and which names they should have. Put any rights if not all to see all the tabs. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Settings in the editor field &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;As the new editor, it is perfectly possible to have different settings on different editor field in the same template. The preamble field would not normally allow the same opportunities as a body field. It would certainly not have as great a field. All this can be customized. Making decisions about size, buttons and design in each field. See attached example from another customer. Please read an old blog post about it here. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Permission to templates / templates available and name &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;When creating a new page, often appear all templates in a list. Which to be displayed can be controlled in various ways and by those that will be available for a certain template, but also by permission. It needs to be fixed so that editors do not think they can create all kinds of pages. Also give all templates logical names and help texts. Sort them in a logical order in the places where they are more in the same list. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Structure and permissions in the file manager &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;About EPiServer file manager is used, there should be a finished structure with permissions on the folders. There must be a logical way to find files and know where to invest. Failure to do this from the beginning, the file manager will be like a haystack that it is impossible to find anything in. It is important to determine the starting points to use, and structure them so that the correct starting point is displayed first. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Folder structure for block &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;If you use EPiServer 7, we also need a folder structure of and access rights to the block.&amp;#160; &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Folders in the form handler &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;It is quite common that there are lots of forms and hence a need to put them in different folders that you should find. Create these folders before training, we learn editors to find right from the start.&lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Permissions in tree structure &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;The various permissions that different groups will have, should be established before the training. It will be silly if a person has the right to do things during the course, but do not have it then. The danger is that it leads to becoming confused by too many things during the course and then when you come back you become frustrated because you can not do things that made during the course. You often think you make a mistake, though, this is actually the system that has limitations. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Clear up the tree structure&lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;The tree should be as clean as possible, with as much &amp;quot;real&amp;quot; data as possible. Remove whatever tests and other devices and control up to any systemic side is a little hidden for editors. The tree should as far as possible reflect the structure you see on the website, it is most logical for the editor. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Multi language / Globalization &lt;/h3&gt;  &lt;p&gt;   &lt;p&gt;In many solutions the language support enabled, though it is not supposed to work in multiple languages. Should the site be only in one language, this function should be disabled. &lt;/p&gt;     &lt;/p&gt;  &lt;h3&gt;Workflows&lt;/h3&gt;  &lt;p&gt;Should workflows used? If not then hide this tab.&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>CMS 7.1 upgrade issues</title>
        <link href="http://world.episerver.com/Blogs/Per-Nilsson/Dates/2013/4/CMS-71-upgrade-issues/" />
        <id>http://world.episerver.com/Blogs/Per-Nilsson/Dates/2013/4/CMS-71-upgrade-issues/</id>
        <updated>2013-04-22T14:41:55.0000000Z</updated>
        <summary type="html">&lt;p style=&quot;width: 100.88%; height: 64px&quot;&gt;Since the release of 7.1 we have had a few cases reporting problems with the update and one example is that edit/admin mode ends up being white without any errors. One possible solution for this is to empty the Temporary ASP.NET files for the site and its listed in the Known issues section for the installations &lt;/p&gt;  &lt;p style=&quot;width: 96.39%; height: 85px&quot;&gt;   &lt;br /&gt;&lt;a href=&quot;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-CMS/Version-7/Installation-Instructions---EPiServer-7-CMS/Installation-Instructions---EPiServer-7-1-CMS/&quot;&gt;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-CMS/Version-7/Installation-Instructions---EPiServer-7-CMS/Installation-Instructions---EPiServer-7-1-CMS/&lt;/a&gt;&lt;/p&gt;  &lt;p style=&quot;width: 100%; height: 60px&quot;&gt;We have received cases where this wasn&#39;t a solution and are investigating the causes for the issues. It has however been hard to reproduce but it got top priority within EPiServer and we will update the Known issues whenever we have more information. &lt;/p&gt;  &lt;p&gt;If the section doesn&#39;t help for your installation then please report your problem on the link below and if you got an environment where the issue can be reproduced it’s even better:&lt;/p&gt;  &lt;p&gt;&amp;#160; &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://world.episerver.com/en/Support/Register-Support-Incident/&quot;&gt;Register Support Incident&lt;/a&gt;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>How to choose a search solution for your EPiServer site</title>
        <link href="http://www.epinova.no/blog/arild-henrichsen/dates/2013/4/how-to-choose-a-search-solution-for-your-episerver-site/" />
        <id>http://www.epinova.no/blog/arild-henrichsen/dates/2013/4/how-to-choose-a-search-solution-for-your-episerver-site/</id>
        <updated>2013-04-21T01:50:26.0000000Z</updated>
        <summary type="html">There&#39;s a jungle of search products out there. Matching their features with your requirements is critical to making the right choice for your site.</summary>
    </entry>    <entry>
        <title>How EPiServer&#39;s HTML helper PropertyFor works</title>
        <link href="http://joelabrahamsson.com/how-episervers-html-helper-propertyfor-works/" />
        <id>http://joelabrahamsson.com/how-episervers-html-helper-propertyfor-works/</id>
        <updated>2013-04-20T12:04:32.0000000Z</updated>
        <summary type="html">&lt;p&gt;When using Web Forms the standard/default/recommended way to render an EPiServer property is to use the EPiServer:Property control. When using ASP.NET MVC its counterpart is the HTML helper &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;PropertyFor&lt;/span&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;That is, PropertyFor is the counterpart the Property control in MVC in terms of being the recommended way to render a property. It is&amp;nbsp;however &lt;em&gt;not&lt;/em&gt; the equivalent of the Property control in terms of functionality.&lt;/p&gt;
&lt;h2&gt;Wrapping elements&lt;/h2&gt;
&lt;p&gt;As you may know, the Property control always wraps the property value in a HTML element. The element differs depending on the property type and can be customized using the CustomTag attribute on the control. This isn&#39;t the case with PropertyFor.&lt;/p&gt;
&lt;p&gt;To examplify, let&#39;s look at the code below where we use the PropertyFor method to render a string property.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    @Html.PropertyFor(x =&amp;gt; x.Heading)
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;Given the Heading property has the value &quot;Banana&quot;, the above will output the following when the page is rendered in view mode.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    Banana
&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;When the page is rendered in edit mode the output will instead be:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    &amp;lt;div class=&quot;epi-editContainer&quot; data-epi-property-name=&quot;Heading&quot; data-epi-use-mvc=&quot;True&quot;&amp;gt;Banana&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;As you can see, the property&#39;s value has been wrapped in a div with a CSS class and a couple of data-attributes.&amp;nbsp;&lt;/p&gt;
&lt;p class=&quot;conclusion&quot;&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;: PropertyFor &lt;em&gt;never&lt;/em&gt; wraps the property&#39;s value in an element when rendering it in view mode. &lt;em&gt;It always&lt;/em&gt; wraps the property&#39;s value in an element when rendering it in edit mode.&lt;/p&gt;
&lt;h3&gt;CustomTag and CssClass&lt;/h3&gt;
&lt;p&gt;As I&#39;ve previously written about, it&#39;s possible to &lt;a href=&quot;/link/7e15400e6eaf4ab7921d0a1becacb9b3.aspx?id=283&amp;amp;epslanguage=en&quot;&gt;pass settings such as CustomTag and CssClass to PropertyFor&lt;/a&gt;. With the Property control the CustomTag setting controls the type of element that the property is wrapped in and the CssClass setting adds one or more CSS classes to the wrapping element.&lt;/p&gt;
&lt;p&gt;Let&#39;s modify the previous example to see what PropertyFor does with them.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    @Html.PropertyFor(x =&amp;gt; x.Heading, new { CustomTag = &quot;h1&quot;, CssClass =&quot;muted&quot; })
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;In view mode this changes the output to:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    Banana
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;That&#39;s right, it doesn&#39;t change the output at all.&lt;/p&gt;
&lt;p&gt;What about when rendered in edit mode?&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    &amp;lt;h1 class=&quot;epi-editContainer&quot; data-epi-property-name=&quot;Heading&quot; data-epi-use-mvc=&quot;True&quot; data-epi-property-rendersettings=&quot;{&amp;amp;quot;customTag&amp;amp;quot;:&amp;amp;quot;h1&amp;amp;quot;,&amp;amp;quot;cssClass&amp;amp;quot;:&amp;amp;quot;muted&amp;amp;quot;}&quot; class=&quot;heading&quot;&amp;gt;Banana&amp;lt;/h1&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;Starting with CustomTag we can see that setting it to h1 changed the type of the wrapping element that PropertyFor added in edit mode.&lt;/p&gt;
&lt;p class=&quot;conclusion&quot;&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt; CustomTag changes the type of element that wrapes the rendered property when rendered in edit mode.&lt;/p&gt;
&lt;p&gt;As for CssClass that added a class attribute with the specified value to the element. However, there already was another class attribute on the element and our custom CSS class wasn&#39;t added to that. It was added as a separate class attribute, meaning that the browser will ignore it. Here&#39;s how FireBug sees the rendered markup:&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail&quot; src=&quot;/PageFiles/633/firebug-custom-class.png&quot; alt=&quot;&quot; width=&quot;625&quot; height=&quot;74&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So, it appears that while CustomTag changes the type of wrapping element that PropertyFor renderes the property in in edit mode CssClass doesn&#39;t, in practice, have any effect on the class attribute on the wrapping element.&lt;/p&gt;
&lt;p&gt;However, there&#39;s another setting we can pass to PropertyFor, EditContainerClass. Let&#39;s see what happens if we use that instead of CssClass, like this:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    @Html.PropertyFor(x =&amp;gt; x.Heading, new { CustomTag = &quot;h1&quot;, EditContainerClass =&quot;muted&quot; })
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;That produces the following when rendered in edit mode:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div&amp;gt;
    &amp;lt;h1 class=&quot;muted&quot; data-epi-property-name=&quot;Heading&quot; data-epi-use-mvc=&quot;True&quot; data-epi-property-rendersettings=&quot;{&amp;amp;quot;customTag&amp;amp;quot;:&amp;amp;quot;h1&amp;amp;quot;,&amp;amp;quot;editContainerClass&amp;amp;quot;:&amp;amp;quot;muted&amp;amp;quot;}&quot;&amp;gt;Banana&amp;lt;/h1&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;p&gt;Look at that. No second class attribute has been added and the first has changed from &quot;epi-editContainer&quot; to the value we specified in EditContainerClass.&lt;/p&gt;
&lt;p class=&quot;conclusion&quot;&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt; CssClass does not change the CSS class for the wrapping element when rendered in edit mode. EditContainerClass does.&lt;/p&gt;
&lt;p&gt;Us specifying CustomTag, CssClass and, later, EditContainerClass also brought another change to the rendered markup in edit mode - a data-epi-property-rendersettings attribute was added to the wrapping element. The attributes value looks to be the serialized version of the anonymous object we used to pass the settings to PropertyFor with.&lt;/p&gt;
&lt;h2&gt;How PropertyFor renders property values&lt;/h2&gt;
&lt;p&gt;So far we&#39;ve looked at how and when PropertyFor wraps the output for a property. But, beyond rendering a wrapping element in edit mode, how does it actually render a property?&lt;/p&gt;
&lt;p&gt;In Web Forms the Property control uses the ClassFactory&amp;nbsp;&lt;/p&gt;
&lt;p&gt;DisplayTemplates&lt;/p&gt;
&lt;p&gt;AdditionalViewData in display templates&lt;/p&gt;
&lt;p&gt;Null check&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>EPiServer 7 patch 2, MVC and session state</title>
        <link href="http://www.popkram.com/blog/?p=2202" />
        <id>http://www.popkram.com/blog/?p=2202</id>
        <updated>2013-04-20T11:22:45.0000000Z</updated>
        <summary type="html">When my colleague Niklas Melinder applied patch 2 for EPiServer 7 he ran into trouble when the site was deployed to our acceptance server. The site started to throw &amp;#8220;System.InvalidOperationException: The SessionStateTempDataProvider class requires session state to be enabled.&amp;#8221;. Since our acceptance environment runs with sessions state switched off it was pretty clear what caused [...]</summary>
    </entry>    <entry>
        <title>Automatically Populating Page or Block Type Properties for a Language Branch in EPiServer 7</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/19/automatically-populating-page-or-block-type-properties-for-a-language-branch-in-episerver-7" />
        <id>http://cjsharp1.github.io/blog/2013/04/19/automatically-populating-page-or-block-type-properties-for-a-language-branch-in-episerver-7</id>
        <updated>2013-04-19T05:02:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;The creation and editing of content for multiple language sites in EPiServer 7 has recently become a topic of conversation in some of our projects. We occasionally receive feedback from our clients who are looking for ways to reduce the amount of time it takes to enter content, while also being consistent with the page and block layout.&lt;/p&gt;

&lt;p&gt;One big change with the new Edit Mode in EPiServer 7, which was available in EPiServer 6 (and technically is still available in the &lt;a href=&quot;http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2013/1/5-Secrets-in-EPiServer-CMS-7-Edit-Mode/&quot;&gt;old Edit Mode&lt;/a&gt;), is that feature to compare the language branches for a page side-by-side has been removed. This was useful for editors who need to keep the content for pages consistent between each language branch, as it allowed them to easily compare the different language branches.&lt;/p&gt;

&lt;p&gt;So to help this, we created a property attribute called &lt;code&gt;[AutoPopulateLanguageBranch]&lt;/code&gt;. Whenever a editor translates a page or block, this copies the values from the master language branch to the new language branch for the decorated page or block type properties. This keeps the content consistent between the language branches, which, at the same time, helps speed up the process of entering content.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;The Code&lt;/h2&gt;

&lt;p&gt;First of all, the ability to translate blocks for different language branches was added with &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Release-Notes/EPiServer-CMS/EPiServer-7/Release-Notes--EPiServer-7-1-CMS/&quot;&gt;the release of EPiServer 7.1&lt;/a&gt;. If you are not running EPiServer 7.1, I recommend &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Installation-Instructions/EPiServer-CMS/Version-7/Installation-Instructions---EPiServer-7-CMS/Installation-Instructions---EPiServer-7-1-CMS/&quot;&gt;upgrading your project&lt;/a&gt; before you start using this attribute.&lt;/p&gt;

&lt;p&gt;We just need three things: the &lt;code&gt;[AutoPopulateLanguageBranch]&lt;/code&gt; attribute to decorate our properties, an initialization module to monitor when we should copy our property values, and an &lt;code&gt;IContent&lt;/code&gt; extension method to actually copy the decorated property values.&lt;/p&gt;

&lt;h3&gt;AutoPopulateLanguageBranchAttribute.cs&lt;/h3&gt;

&lt;p&gt;We start with a simple attribute to decorate our page type properties and block type properties.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[AttributeUsage(AttributeTargets.Property)]
public class AutoPopulateLanguageBranchAttribute : Attribute
{
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;AutoPopulateLanguageBranchInitializationModule.cs&lt;/h3&gt;

&lt;p&gt;The first main piece of this is the initialization module. This attaches (and detaches) the &lt;code&gt;InitializeContentLanguageBranch&lt;/code&gt; method to the &lt;code&gt;LoadedDefaultContent&lt;/code&gt; event of the &lt;code&gt;DataFactory&lt;/code&gt;, which &lt;a href=&quot;http://world.episerver.com/Documentation/Class-library/?documentId=cms/7/fedd145e-c37d-fb4b-9b78-599dea86f360&quot;&gt;&quot;occurs when a new content item has been created and initialized&quot;&lt;/a&gt;. This method is essentially just some preventative checks and content data setup. We need to make sure we have legitimate content, and that the content we are working with is not on the master language branch. Then, we grab the content data from the master language branch, so we have something to copy over to the new language branch. Once we have everything, we send it over to &lt;code&gt;ContentExtensions&lt;/code&gt; for the copying of property values.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[InitializableModule]
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
public class AutoPopulateLanguageBranchInitializationModule : IInitializableModule
{
    public void Initialize(EPiServer.Framework.Initialization.InitializationEngine context)
    {
        DataFactory.Instance.LoadedDefaultContent += InitializeContentLanguageBranch;
    }

    public void Preload(string[] parameters)
    {
    }

    public void Uninitialize(EPiServer.Framework.Initialization.InitializationEngine context)
    {
        DataFactory.Instance.LoadedDefaultContent -= InitializeContentLanguageBranch;
    }

    private void InitializeContentLanguageBranch(object sender, ContentEventArgs e)
    {
        if (e.Content != null &amp;amp;&amp;amp; e.Content.ContentGuid != Guid.Empty)
        {
            var contentLanguage = new ContentLanguageEventArgs(e.Content);
            if (contentLanguage != null &amp;amp;&amp;amp; !contentLanguage.IsMasterLanguageBranch)
            {
                var contentLoader = ServiceLocator.Current.GetInstance&amp;lt;IContentLoader&amp;gt;();
                var masterLanguageContent = contentLoader.Get&amp;lt;IContent&amp;gt;(contentLanguage.ContentLink, new LanguageSelector(contentLanguage.MasterLanguageBranch));
                if (masterLanguageContent != null)
                {
                    e.Content.InitializeDefaultPropertyData(masterLanguageContent);
                }
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;ContentExtensions.cs&lt;/h3&gt;

&lt;p&gt;The second main piece is the extension method &lt;code&gt;InitializeDefaultPropertyData&lt;/code&gt; for the &lt;code&gt;IContent&lt;/code&gt; interface. Once again, we do some preventative checks, then get the page/block &lt;code&gt;Type&lt;/code&gt;, so we can look through the properties and see which ones are decorated with the &lt;code&gt;[AutoPopulateLanguageBranch]&lt;/code&gt; attribute. After we have on all the properties, we simply copy the &lt;code&gt;Value&lt;/code&gt; over from the &lt;code&gt;sourceContent&lt;/code&gt; to the &lt;code&gt;targetContent&lt;/code&gt;. Finally, we return the &lt;code&gt;targetContent&lt;/code&gt; back to the module.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public static class ContentExtensions
{
    public static IContent InitializeDefaultPropertyData(this IContent targetContent, IContent sourceContent)
    {
        if (sourceContent == null || 
            sourceContent.GetType() != targetContent.GetType() || 
            sourceContent.GetType().BaseType == null)
        {
            return targetContent;
        }

        var type = sourceContent.GetType().BaseType;

        foreach (var property in type.GetProperties().Where(p =&amp;gt; p.GetCustomAttributes(typeof(AutoPopulateLanguageBranchAttribute), true).Length &amp;gt; 0))
        {
            if (property != null &amp;amp;&amp;amp; 
                targetContent.Property[property.Name] != null &amp;amp;&amp;amp; 
                targetContent.Property[property.Name].IsLanguageSpecific)
            {
                targetContent.Property[property.Name].Value = sourceContent.Property[property.Name].Value;
            }
        }

        return targetContent;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;The Usage&lt;/h2&gt;

&lt;p&gt;Using the &lt;code&gt;[AutoPopulateLanguageBranch]&lt;/code&gt; attribute is really straightforward... Just decorate the properties that you want to copy over in your page types or block types.&lt;/p&gt;

&lt;p&gt;So for a page type, it could look something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[ContentType(GUID = &quot;00000000-0000-0000-0000-000000000000&quot;)]
public class StandardPage : PageData
{
    [CultureSpecific]
    [AutoPopulateLanguageBranch]
    public virtual XhtmlString MainBody { get; set; }

    [CultureSpecific]
    [AutoPopulateLanguageBranch]
    public virtual ContentArea MainContentArea { get; set; }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or for a block type:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[ContentType(GUID = &quot;00000000-0000-0000-0000-000000000000&quot;)]
public class ImageBlock : BlockData
{
    [CultureSpecific]
    [AutoPopulateLanguageBranch]
    [UIHint(UIHint.Image)]
    public virtual Url Image { get; set; }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It&#39;s pretty obvious that the &lt;code&gt;[AutoPopulateLanguageBranch]&lt;/code&gt; attribute is commonly seen next to the &lt;code&gt;[CultureSpecific]&lt;/code&gt; attribute. If the property is not decorated with &lt;code&gt;[CultureSpecific]&lt;/code&gt;, then it will be skipped during the copy process.&lt;/p&gt;

&lt;p&gt;A nice part about this attribute is that it can populate a page&#39;s &lt;code&gt;ContentArea&lt;/code&gt; property with the blocks that are placed in it, and if the block has not yet been translated to the new language branch, it will fallback and show the content data for the block&#39;s master language branch. This is what the block will look like on a page in Edit Mode:&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;center&quot; src=&quot;/assets/images/AutoPopulateLanguageBranch/UntranslatedBlock.PNG&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That gives the editor a really good visual cue that the block needs to be translated to the new language branch.&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Add UIHint to an EPiServer property without affecting its editor</title>
        <link href="http://joelabrahamsson.com/add-uihint-to-an-episerver-property-without-affecting-its-editor/" />
        <id>http://joelabrahamsson.com/add-uihint-to-an-episerver-property-without-affecting-its-editor/</id>
        <updated>2013-04-18T13:49:30.0000000Z</updated>
        <summary type="html">&lt;p&gt;We can use UI hints to make the PropertyFor and DisplayFor methods use a specific display template when rendering properties with ASP.NET MVC.&lt;/p&gt;
&lt;p&gt;For instance, when rendering a property like this...&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;[UIHint(&quot;Banana&quot;)]&lt;br /&gt;public virtual string Heading { get; set; }&lt;/pre&gt;
&lt;p&gt;...using Html.PropertyFor() it will be &quot;sent&quot; to a display template named Banana, given such a template exists.&lt;/p&gt;
&lt;p&gt;There&#39;s just one problem. When adding a UI hint that no editor descriptor cares about we loose the original editing functionality for the property and it will be edited using the &quot;legacy&quot; editing functionality. That is, instead of a textbox for a string property editors will see a button saying &quot;Click the button to edit&quot;.&lt;/p&gt;
&lt;p&gt;To fix that, use an overload for the UIHint attribute and specify&amp;nbsp;&lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;PresentationLayer.Website&lt;/span&gt;&lt;/strong&gt;, like this:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;[UIHint(&quot;Banana&quot;, PresentationLayer.Website)]&lt;br /&gt;public virtual string Heading { get; set; }&lt;/pre&gt;
&lt;p&gt;One caveat, while this works great with PropertyFor it won&#39;t work with DisplayFor which won&#39;t recognize the UI hint any longer.&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Specify z-index for a property&#39;s overlay in EPiServer&#39;s on page edit mode</title>
        <link href="http://joelabrahamsson.com/specify-z-index-for-a-propertys-overlay-in-episervers-on-page-edit-mode/" />
        <id>http://joelabrahamsson.com/specify-z-index-for-a-propertys-overlay-in-episervers-on-page-edit-mode/</id>
        <updated>2013-04-18T13:31:47.0000000Z</updated>
        <summary type="html">&lt;p&gt;Sometimes two property values overlap when rendered in a template. It may for instance be a string property whose value should be rendered on top of an image which is also a property. Or it may be a link/URL property that should be rendered at the of a string property.&lt;/p&gt;
&lt;p&gt;By default both properties will have an overlay, the thin blue border that is positioned on top of the element in which the property value is rendered. However, only one of them will be clickable.&lt;/p&gt;
&lt;p&gt;To handle that we can specify the z-index for the overlay for the property that isn&#39;t clickable. To do so add a&amp;nbsp;&lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;data-epi-overlay-z-index&lt;/span&gt;&lt;/strong&gt; attribute to the element that contains the property. For instance, when using ASP.NET MVC and Razor:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;h1 data-epi-overlay-z-index=&quot;123&quot; @Html.EditAttributes(x =&amp;gt; x.Heading)&amp;gt;
    @Model.Heading
&amp;lt;/h1&amp;gt;&lt;br /&gt;&lt;/pre&gt;
</summary>
    </entry>    <entry>
        <title>ImageVault 4 is now available for EPiServer 7 CMS!</title>
        <link href="http://blog.imagevault.se/post/48273577641" />
        <id>http://blog.imagevault.se/post/48273577641</id>
        <updated>2013-04-18T12:30:24.0000000Z</updated>
        <summary type="html">&lt;p&gt;The use of digital media on the web has rapidly increased during the past years and every organization today has the need to use some type of digital media (e.g. images or streaming media) to convey their message in an efficient manner. Today’s users also has a greater expectation on their CMS platform to have some kind of capability for managing digital media in a more structured way that facilitates the process of using digital assets on the web.&lt;/p&gt;
&lt;p&gt;In the report ”Digital Asset Management Q2&amp;#160;2012” Forester highlight Digital Asset Management’s touch points with Content Management: &lt;/p&gt;
&lt;p&gt;&lt;em&gt;Organizations look to integrate rich media management solutions with other enterprise applications &amp;#8212; particularly those that deliver online content. And DAM’s role in supporting persuasive content makes it an important part of the new set of CXM solutions for engaging customer experiences.&lt;/em&gt; &lt;br /&gt;&lt;br /&gt;Find out more about ImageVault 4 and EPiServer 7 CMS &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://world.episerver.com/Articles/Items/Media-Asset-Management-for-EPiServer-CMS/&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;image&quot; src=&quot;http://media.tumblr.com/4ddf4b1dd11e4f10c776174970977f74/tumblr_inline_mleajevyO21qz4rgp.png&quot; /&gt;&lt;/p&gt;




&lt;p&gt;&lt;img alt=&quot;image&quot; src=&quot;http://media.tumblr.com/b8d4c10d6352cfc33d3e21840b792c68/tumblr_inline_mleak3EoXs1qz4rgp.png&quot; /&gt;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Changes to the module.config for EPiServer 7.1</title>
        <link href="http://world.episerver.com/Blogs/Ben-McKernan/Dates/2013/4/Changes-to-the-moduleconfig-for-EPiServer-71/" />
        <id>http://world.episerver.com/Blogs/Ben-McKernan/Dates/2013/4/Changes-to-the-moduleconfig-for-EPiServer-71/</id>
        <updated>2013-04-18T08:50:15.0000000Z</updated>
        <summary type="html">&lt;p&gt;I’ve seen on the forum that there have been several people having issues running their custom dojo code after the EPiServer 7.1 update. So I thought I’d mention these issues, their cause and the solution.&lt;/p&gt;
&lt;h2&gt;Required Resources Key Changed for CMS&lt;/h2&gt;
&lt;p&gt;So I’ve demonstrated in previous blog posts that it’s possible to initialize a module without having a component. This was done by using a little trick to add an initializer script to the required resources for CMS by adding the following to your module.config file.&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;clientResources&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;epi.cms.widgets.base&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;initialize.js&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;resourceType&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;Script&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;clientResources&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;With the upgrade to dojo 1.8.3 we changed the dojo package name for CMS to be epi-cms. This is due to the fact that dojo has made changes in their loader which means that dot or slash separated package names are no longer supported. To be consistent with our naming we also changed the key for required resources. So the following are now the required resource keys:&lt;/p&gt;
&lt;p&gt;EPiServer 7: &lt;span style=&quot;font-family: monospace;&quot;&gt;epi.cms.widgets.base&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;EPiServer 7.1: &lt;span style=&quot;font-family: monospace;&quot;&gt;epi-cms.widgets.base&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;JavaScript Package Naming&lt;/h2&gt;
&lt;p&gt;As mentioned previously dojo have changed their loader to be fully AMD compliant and as such dot or slash separated names are no longer supported. For example the following is no longer supported:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;dojoModules&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;  &lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;add&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;my.addon&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;=&quot;scripts/addon&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000;&quot;&gt;dojoModules&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;My suggestion if you are in this situation is to change the delimiter from dot or slash to be a dash instead. Meaning that in the above example the package name would instead be &lt;span style=&quot;font-family: monospace;&quot;&gt;my-addon.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hopefully this helps anybody who runs into similar issues!&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>How to Delete the Language Branch for a Page or a Block in EPiServer 7</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/17/how-to-delete-the-language-branch-for-a-page-or-a-block-in-episerver-7" />
        <id>http://cjsharp1.github.io/blog/2013/04/17/how-to-delete-the-language-branch-for-a-page-or-a-block-in-episerver-7</id>
        <updated>2013-04-18T02:57:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;The release of EPiServer 7 has brought numerous changes to the way editors interact with Edit Mode. One such change is the process needed to remove the language branch for a page or a block. Of course, you could always use the &lt;a href=&quot;http://world.episerver.com/Blogs/Alexander-Haneng/Dates/2013/1/5-Secrets-in-EPiServer-CMS-7-Edit-Mode/&quot;&gt;old Edit Mode&lt;/a&gt; to complete this task, but let&#39;s find out how to do this in EPiServer 7&#39;s new Edit Mode.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;The EPiServer 6 Way&lt;/h2&gt;

&lt;p&gt;&lt;img class=&quot;right&quot; src=&quot;/assets/images/DeleteLanguageBranch/DeleteLangBranchEPi6.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In EPiServer 6, the process to delete the language branch for a page was pretty straightforward, primarily because the &quot;Delete Language&quot; link was located in the context menu (right-click) of the page.&lt;/p&gt;

&lt;p&gt;If you prefer to use EPiServer 7&#39;s old Edit Mode, this hasn&#39;t changed at all; you&#39;ll still get the context menu and this menu still looks the same.&lt;/p&gt;

&lt;p&gt;One issue with EPiServer 6, though, was that you couldn&#39;t delete a language branch for the Start Page. The workaround to solve this was to point the site&#39;s Start Page to a different page, remove the language branch, then point the site&#39;s Start Page back to the correct one. This might not be a big deal for development environments, but once you move to a production server, this could possibly cause some issues.&lt;/p&gt;

&lt;h2&gt;The EPiServer 7 Way&lt;/h2&gt;

&lt;p&gt;In EPiServer 7, since the context menu was removed, the link to delete the language branch for a page or a block had to be relocated. You&#39;ll now find the link in the Versions gadget.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;right&quot; src=&quot;/assets/images/DeleteLanguageBranch/DeleteLangBranchEPi7.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In the navigation pane or the assets pane, click the &quot;Settings&quot; button (the little cog) in the upper corner next to the &quot;Pin&quot; button, and click the &quot;Add Gadgets&quot; link. In the modal that opens, scroll down and click &quot;Versions&quot;. (Simply clicking &quot;Versions&quot; will add the gadget; you will not recieve any notifications that it added the gadget.) The gadget will appear by default at the bottom of the navigation/assets pane. Once the gadget has been added and is visible, you&#39;ll find the &quot;Delete &lt;em&gt;{insert your current language}&lt;/em&gt; Language Branch&quot; link when you click the &quot;More options&quot; button.&lt;/p&gt;

&lt;p&gt;You should note that the Versions gadget that you open in the navgiation pane is the same that you open in the assets pane. So if you are trying to delete the language branch for a block, you need to go into the block&#39;s &quot;Edit&quot; screen, otherwise you&#39;ll still be working with the page&#39;s version. It&#39;s probably good idea to actually read the &quot;Delete Language Branch&quot; confirmation window, so you don&#39;t make a mistake when deleting the language branch. &lt;strong&gt;Deleting the language branch for a page or a block does not put it in the Trash. It cannot be undone.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;EPiServer 7 also now has the ability to delete a language branch for the Start Page. The same link in the Versions gadget will allow you to do this.&lt;/p&gt;

&lt;p&gt;Unfortunately, you will not be able to delete the language branch if you&#39;re on the master language branch (typically the &quot;EN&quot; branch). The link will be grayed out, diabled, and unclickable.&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Configuring TinyMCE using EPiServer custom property settings</title>
        <link href="http://www.markeverard.com/?p=2092" />
        <id>http://www.markeverard.com/?p=2092</id>
        <updated>2013-04-17T12:19:39.0000000Z</updated>
        <summary type="html">The TinyMCE rich-text editor provides great flexibility for editors to create and mark-up content within EPiServer. TinyMCE is a seemingly infinitely configurable tool and can be configured to show / hide many of its available features.&#160; One of the ways EPiServer Administrators / Developers / Integrators can help is by configuring TinyMCE to only show [...]</summary>
    </entry>    <entry>
        <title>Hide pages in the page tree in EPiServer 7</title>
        <link href="http://tedgustaf.com//link/13d760d0ca0048efa67c621c53d4ae50.aspx?id=321&amp;epslanguage=en" />
        <id>http://tedgustaf.com//link/13d760d0ca0048efa67c621c53d4ae50.aspx?id=321&amp;epslanguage=en</id>
        <updated>2013-04-17T10:18:04.0000000Z</updated>
        <summary type="html">&lt;p class=&quot;intro&quot;&gt;Sometimes it could be useful to manipulate how certain pages are displayed in the page tree in EPiServer 7. Because the page tree is loaded from a REST based store, all you really need to do is provide a custom implementation of the ContentQuery responsible for...&lt;/p&gt;&lt;p&gt;Sometimes it could be useful to manipulate how certain pages are displayed in the page tree in EPiServer 7. Because the page tree is loaded from a REST based store, all you really need to do is provide a custom implementation of the ContentQuery responsible for loading the children.&lt;/p&gt;
&lt;p&gt;The REST stores in EPiServer are discovered at application startup. The &lt;strong&gt;ContentStructureStore&lt;/strong&gt; which is used for loading content into the page tree (no shit?), will be provided with a number of ContentQuery classes at initialization. One of them is &lt;strong&gt;EPiServer.Cms.Shell.UI.Rest.ContentQuery.GetChildrenQuery&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;Provide your custom query&lt;/h3&gt;
&lt;p&gt;First add a reference to &lt;strong&gt;EPiServer.Cms.Shell.UI assembly&lt;/strong&gt;. Yes, you will now have a dependency to an EPiServer module, so think about that for a moment.&lt;/p&gt;
&lt;p&gt;Then add your own &lt;strong&gt;GetChildrenQuery&lt;/strong&gt; class. You get alot of goodies through the &lt;strong&gt;ContentQueryParameters&lt;/strong&gt; object passed to &lt;strong&gt;GetContent&lt;/strong&gt;, such as &lt;strong&gt;CurrentPrincipal&lt;/strong&gt;, &lt;strong&gt;CurrentLanguage&lt;/strong&gt; etc.&lt;/p&gt;
&lt;p&gt;So, short example. I’ll hide all content that have a name containing “Alloy”.&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; height: 229px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; System.Diagnostics;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Cms.Shell.UI.Rest.ContentQuery;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.Core;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;using&lt;/span&gt; EPiServer.ServiceLocation;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;namespace&lt;/span&gt; EPiServer.Templates.Alloy.Business&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;    [ServiceConfiguration(&lt;span style=&quot;color: #0000ff;&quot;&gt;typeof&lt;/span&gt;(IContentQuery))]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt; MyGetChildrenQuery : GetChildrenQuery&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; MyGetChildrenQuery(IContentQueryHelper queryHelper, IContentRepository contentRepository, LanguageSelectorFactory languageSelectorFactory) : &lt;span style=&quot;color: #0000ff;&quot;&gt;base&lt;/span&gt;(queryHelper, contentRepository, languageSelectorFactory)&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;        &lt;span style=&quot;color: #0000ff;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;override&lt;/span&gt; IEnumerable&amp;lt;IContent&amp;gt; GetContent(ContentQueryParameters parameters)&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;            &lt;span style=&quot;color: #0000ff;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;base&lt;/span&gt;.GetContent(parameters).Where(x =&amp;gt; !x.Name.Contains(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Alloy&quot;&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: white; border-style: none; padding: 0px;&quot;&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;&quot;&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;</summary>
    </entry>    <entry>
        <title>EPiServer Find 101</title>
        <link href="http://joelabrahamsson.com/episerver-find-101/" />
        <id>http://joelabrahamsson.com/episerver-find-101/</id>
        <updated>2013-04-16T20:36:20.0000000Z</updated>
        <summary type="html">New to EPIServer Find and want a jump start? Here&#39;s what you need to know.
&lt;p&gt;If you&#39;re new to EPiServer Find and going to use it in a project, or just want to try it out, there&#39;s plenty of &lt;a href=&quot;http://find.episerver.com/Documentation&quot;&gt;documentation on Find&#39;s site&lt;/a&gt;. There&#39;s also training offered by EPiServer. Not to mention &lt;a href=&quot;/Modules/Forum/Pages/Forum.aspx?id=58826&amp;amp;epslanguage=en&quot;&gt;the forum&lt;/a&gt; on EPiServer World.&lt;/p&gt;
&lt;p&gt;Sometimes you need a little quick start though. Here&#39;s the most essential things to know about Find&#39;s .NET API and CMS integration.&lt;/p&gt;
&lt;h2&gt;Setting up&lt;/h2&gt;
&lt;p&gt;You can grab yourself a free test index at &lt;a href=&quot;http://find.episerver.com&quot;&gt;find.episerver.com&lt;/a&gt;.&amp;nbsp;Once you have created your index you can copy and paste the necessary configuration into your app.config or web.config.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/623/Find-configuration.png&quot; alt=&quot;&quot; width=&quot;714&quot; height=&quot;378&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Finally you need to download and reference Find&#39;s .NET API. That&#39;s easily done through NuGet given that you have EPiServer&#39;s NuGet feed added as a package source. There&#39;s three packages to choose from. For an EPiServer CMS site install&amp;nbsp;&lt;strong&gt;EPiServer Find CMS Integration&lt;/strong&gt;. For any other type of .NET application install&amp;nbsp;&lt;strong&gt;EPiServer Find Client API&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;Communicating with the REST API&lt;/h2&gt;
&lt;p&gt;You can use the .NET API from any .NET application. When doing so, all communication with Find&#39;s REST API goes through an instance of the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;IClient&lt;/span&gt;&lt;/strong&gt; interface. To obtain such an instance when not using the CMS integration you can use the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;Client.CreateFromConfig()&lt;/span&gt;&lt;/strong&gt; method to create it based on settings in app.config/web.config.&lt;/p&gt;
&lt;p&gt;If you&#39;re using the CMS integration or any other integration for other EPiServer products&amp;nbsp;&lt;em&gt;always&lt;/em&gt; use the singleton &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;SearchClient.Instance&lt;/span&gt;&lt;/strong&gt;. This is important. The singleton is preconfigured with conventions set up for CMS content.&lt;/p&gt;
&lt;blockquote&gt;&quot;If you&#39;re using the CMS integration&amp;nbsp;always&amp;nbsp;use the singleton SearchClient.Instance&quot;&lt;/blockquote&gt;
&lt;h2&gt;Finding things&lt;/h2&gt;
&lt;p&gt;Once you have a client search for indexed objects (CMS objects are automatically indexed upon save) using the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;Search&amp;lt;T&amp;gt;()&lt;/span&gt;&lt;/strong&gt; method where T is the type of objects you want to search for. The method supports inheritance and searching for objects that implement an interface.&lt;/p&gt;
&lt;p&gt;The Search method returns an object which you can add queries and filters to. Use the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;For&lt;/span&gt;&lt;/strong&gt; method for free text search. Use the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;Filter&lt;/span&gt;&lt;/strong&gt; method to apply criterias.&lt;/p&gt;
&lt;p&gt;The Filter method is very similar to LINQ&#39;s Where method but has a slightly different syntax. You can filter on any property of a &quot;simple&quot; type, such as int, string, DateTime, double, GUID etc. Check out &lt;a href=&quot;http://find.episerver.com/Documentation/dotnet-api-filtering&quot;&gt;the documentation&lt;/a&gt; for more information or use Intellisense.&lt;/p&gt;
&lt;p&gt;You can use methods with familiar names from LINQ to apply sorting, projections and paging - &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;OrderBy&lt;/span&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;Select&lt;/span&gt;&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;Skip&lt;/span&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;Take&lt;/span&gt;&lt;/strong&gt; etc.&lt;/p&gt;
&lt;p&gt;Once you&#39;re done building your search request execute it against the REST API and get the result using the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;GetResult()&lt;/span&gt;&lt;/strong&gt; method. The returned object will be an object the implements IEnumerable&amp;lt;T&amp;gt; so you can start iterating over the results straight away.&lt;/p&gt;
&lt;p&gt;Note that if you&#39;re searching for CMS objects such as PageData and want to fetch the full objects you shouldn&#39;t use GetResult but instead use the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;GetContentResult()&lt;/span&gt;&lt;/strong&gt; method. When using the integration for CMS 6, that&#39;s called GetPagesResult.&lt;/p&gt;
&lt;blockquote&gt;&quot;if you&#39;re searching for CMS objects such as PageData and want to fetch the full objects ... use the GetContentResult() method&quot;&lt;/blockquote&gt;
&lt;h3&gt;Unified Search&lt;/h3&gt;
&lt;p&gt;One of the things that makes Find powerful and easy to use at the same time is the fact that it let&#39;s us index our own .NET object and search for them in a strongly typed way. Sometimes though, such as building a search page, we want to search over many different types. Find makes that easy to using a concept called &lt;a href=&quot;http://find.episerver.com/Documentation/unified-search&quot;&gt;Unified Search&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In general - use the regular Search method for building listings, navigations and specialized search page with ease and use Unified Search when building free text search pages where users should search in *everything*.&lt;/p&gt;
&lt;h2&gt;Where to go from here&lt;/h2&gt;
&lt;p&gt;That&#39;s it. A few key concepts to get you started and a few important things to remember to avoid being faced by a YSOD.&lt;/p&gt;
&lt;p&gt;Once you&#39;ve familiarized yourself with Find&#39;s .NET API you can move on to &lt;a href=&quot;http://find.episerver.com/Documentation/dotnet-api-indexing&quot;&gt;indexing custom objects&lt;/a&gt; or why not check out some of the more specialized and interesting methods such as &lt;a href=&quot;http://find.episerver.com/Documentation/dotnet-api-more-like-related-documents&quot;&gt;MoreLike&lt;/a&gt; and &lt;a href=&quot;http://find.episerver.com/Documentation/dotnet-api-boosting-with-filters&quot;&gt;BoostMatching&lt;/a&gt;. Also, don&#39;t miss out of the many types of &lt;a href=&quot;http://find.episerver.com/Documentation/dotnet-api-facets&quot;&gt;facets&lt;/a&gt; which you can use to build many interesting things.&lt;/p&gt;
&lt;p&gt;Want to build a search page for an EPiServer site quickly? &lt;a href=&quot;/link/d90bae5d27f847289132b12e7b94750f.aspx?id=254&amp;amp;epslanguage=en&quot;&gt;Here&#39;s one&lt;/a&gt; complete with annotated source code for you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Happy Finding!&lt;/strong&gt;&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Unwanted Lucene Search Results in EpiServer Commerce R2</title>
        <link href="http://kkhan-episerver.blogspot.com/2013/04/unwanted-lucene-search-results-in.html" />
        <id>http://kkhan-episerver.blogspot.com/2013/04/unwanted-lucene-search-results-in.html</id>
        <updated>2013-04-16T08:33:00.0000000Z</updated>
        <summary type="html">&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Issue:&lt;/b&gt; User was getting unexpected search results for products, e.g. with a search key word ‘Sate’ he was getting same result as for ‘Site’. Although for most of the clients they will happy with these results but this particular client was unhappy with this result due to their business requirements. We do not have any word like ‘Sate’ in our Database or in Index file for Lucene. Clearly it was Fuzzy search that was causing this although in code we have set FuzzySearch = false;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Reason: &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Perform Lucene search&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-highlight: white;&quot;&gt;SearchResults&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt; results = searchFilterHelper.SearchEntries(criteria) &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-highlight: white;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-highlight: white;&quot;&gt;SearchResults&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In the Mediachase.Commerce.Website, Version=5.2.243.2, SearchFilterHelper&#39;s SearchEntries() method, below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;public virtual ISearchResults SearchEntries(CatalogEntrySearchCriteria criteria) {&amp;nbsp; try&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; _Results = &lt;b&gt;Manager.Search(criteria);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;catch (SystemException)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; if (HttpContext.Current.IsDebuggingEnabled)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp; throw;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;// Perform fuzzy search if nothing has been found&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;if (_Results.TotalCount == 0)&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; criteria.IsFuzzySearch = true;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; criteria.FuzzyMinSimilarity = 0.7f;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; _Results = Manager.Search(criteria);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;return _Results;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;As you can see there is an initial call to Manager.Search().&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Before returning, the TotalCount property on the ISearchResults object returned is checked to see if there were no results.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoPlainText&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If there are no results a fuzzy search is done.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;That was causing the issue although iSFuzzySearch was false at the time of request.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Fix:&lt;/b&gt; A fix is present in Episerver Commerce R2 Sp2. There is an extra Function is available that can be used to stop FuzzySearch if no result is found with actual keyword.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&amp;nbsp;&lt;span style=&quot;color: brown;&quot;&gt;virtual&lt;/span&gt;&amp;nbsp;ISearchResults&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: midnightblue;&quot;&gt;SearchEntries&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: darkgreen;&quot;&gt;(&lt;/span&gt;CatalogEntrySearchCriteria criteria&lt;span style=&quot;color: darkgreen;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;bool&lt;/span&gt;&lt;/b&gt;&amp;nbsp;isFuzzySearch&lt;span style=&quot;color: darkgreen;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;float&lt;/span&gt;&lt;/b&gt;&amp;nbsp;minSimilarity&lt;span style=&quot;color: darkgreen;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Perform Lucene search&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-highlight: white;&quot;&gt;SearchResults&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt; results = searchFilterHelper.SearchEntries(criteria,&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-highlight: white;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;,0) &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-highlight: white;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; line-height: 115%; mso-highlight: white;&quot;&gt;SearchResults&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;;&lt;/span&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;Special thanks to Jeff from EpiServer’s Developer Support team to find out the reason and fix.&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Example Code&lt;/b&gt;:&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;internal&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CatalogIndexSearchDataSource&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; CreateDataSource(&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SearchFilterHelper&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; filter, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; pageNo, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; pageSize, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; totalRows, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; cacheResults, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; cacheTime, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; nodeString, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; keywords, &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;List&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;gt; metaClasses)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; currentCulture = &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Thread&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.CurrentThread.CurrentUICulture;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Thread&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.CurrentThread.CurrentUICulture = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CultureInfo&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SiteContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.LanguageName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; recordsToRetrieve = pageSize;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//cache timeout&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;TimeSpan&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; cacheTimeout = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;TimeSpan&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(0, (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;)cacheTime, 0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Perform search&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SearchSort&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; sortObject = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Put default sort order if none is set&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (sortObject == &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sortObject = &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CatalogEntrySearchCriteria&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.DefaultSortOrder;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; criteria = filter.CreateSearchCriteria(keywords, sortObject);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//If meta classes are given to search.&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (metaClasses != &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; metaClass &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; metaClasses)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; criteria.SearchIndex.Add(metaClass);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//Add catalogs&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; row &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CatalogContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.GetCatalogDto(&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SiteContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.SiteId).Catalog)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (row.IsActive &amp;amp;&amp;amp; row.StartDate &amp;lt;= &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;FrameworkContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.CurrentDateTime &amp;amp;&amp;amp; row.EndDate &amp;gt;= &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;FrameworkContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.CurrentDateTime)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;criteria.CatalogNames.Add(row.Name);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//add catalog nodes&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (!&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.IsNullOrEmpty(nodeString))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; outline &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SearchFilterHelper&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.GetOutlinesForNode(nodeString))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; criteria.Outlines.Add(outline);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CatalogIndexSearchDataSource&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dataSource = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// No need to perform search if no catalogs specified&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (criteria.CatalogNames.Count != 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Entries&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; entries = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Entries&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Perform Lucene search&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SearchResults&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; results = searchFilterHelper.SearchEntries(criteria,&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;,0) &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SearchResults&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Get IDs we need&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;[] resultIndexes = results.GetIntResults(pageNumber , maxRows+5); &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// we add padding here to accomodate entries that might have been deleted since last indexing&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (resultIndexes.Length &amp;gt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;[] productResultIndexes = &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;RefinementHelper&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.GetParentProducts(pageSize, pageNumber, resultIndexes, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;ref&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; totalRows);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Retrieve actual entry objects, with no caching&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entries = &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CatalogContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.GetCatalogEntries(productResultIndexes, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;TimeSpan&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(), responseGroup);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Add in attribute information&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddAttributes(entries, results);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Insert to the cache collection&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; entries.TotalResults = totalRows;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CatalogCache&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Insert(cacheKey, entries, cacheTimeout);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataSource = &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;CatalogIndexSearchDataSource&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; { TotalResults = totalRows, CatalogEntries = entries };&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Thread&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.CurrentThread.CurrentUICulture = currentCulture;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; dataSource;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</summary>
    </entry>    <entry>
        <title>Sending settings from the server to your editor</title>
        <link href="http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2013/4/Sending-settings-from-the-server-to-your-editor/" />
        <id>http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2013/4/Sending-settings-from-the-server-to-your-editor/</id>
        <updated>2013-04-16T07:20:10.0000000Z</updated>
        <summary type="html">&lt;p&gt;I got a question how you can send settings that are defined on the server to an editor. It’s really quite simple so lets have a look on a simple example. We start by defining an editor descriptor and adding an entry in the EditorConfiguration dictionary:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;[EditorDescriptorRegistration(TargetType = &lt;span style=&quot;color: #0000ff;&quot;&gt;typeof&lt;/span&gt;(&lt;span style=&quot;color: #0000ff;&quot;&gt;string&lt;/span&gt;), UIHint = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;author&quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt; AuthorEditorDescriptor : EditorDescriptor&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; AuthorEditorDescriptor()&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;        ClientEditingClass = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;alloy.editors.AuthorSelector&quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;        EditorConfiguration[&lt;span style=&quot;color: #006080;&quot;&gt;&quot;foo&quot;&lt;/span&gt;] = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;bar&quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The settings in the EditorConfiguration dictionary is mixed on to the editor instance when started so you can access these settings as they were regular properties of your editor. This sample checks the value of foo in the postCreate-method:&lt;/p&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;postCreate: &lt;span style=&quot;color: #0000ff;&quot;&gt;function&lt;/span&gt; () {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    &lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color: #0000ff;&quot;&gt;this&lt;/span&gt;.foo === &lt;span style=&quot;color: #006080;&quot;&gt;&quot;bar&quot;&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;        alert(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Happy happy joy&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style=&quot;text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;&quot;&gt;},&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And when the editor starts we get:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/25614/2013/04/16/image_2.png&quot;&gt;&lt;img style=&quot;background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;&quot; title=&quot;image&quot; src=&quot;/Globals/xmlrpc/25614/2013/04/16/image_thumb.png&quot; border=&quot;0&quot; alt=&quot;image&quot; width=&quot;393&quot; height=&quot;208&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>How to Add Valid Elements (like iframes) to TinyMCE in EPiServer 7</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/15/how-to-add-valid-elements-like-iframes-to-tinymce-in-episerver-7" />
        <id>http://cjsharp1.github.io/blog/2013/04/15/how-to-add-valid-elements-like-iframes-to-tinymce-in-episerver-7</id>
        <updated>2013-04-16T03:23:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;In a recent EPiServer 7 project, our client needed support for iframes and some other HTML tags in the &lt;a href=&quot;http://www.tinymce.com/&quot;&gt;TinyMCE WYSIWYG editor&lt;/a&gt;. Luckily, the way you add valid elements to TinyMCE hasn&#39;t changed much between EPiServer 6 and EPiServer 7, though some small issues have made the update a little more involved. In this post, I&#39;ll show you how to add valid elements to TinyMCE and how to fix the issues you&#39;ll potentially encounter along the way.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;What Hasn&#39;t Changed&lt;/h2&gt;

&lt;p&gt;Like EPiServer 6, you need to add a simple class to your project to register the extended valid elements. The name and location of the class does not matter, as long as it is compiled into your project. The most important part of this that we are focusing on is the &lt;code&gt;TinyMCEPluginNonVisual&lt;/code&gt; attribute&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[TinyMCEPluginNonVisual(AlwaysEnabled = true, EditorInitConfigurationOptions = &quot;{ extended_valid_elements: &#39;iframe[src|frameborder=0|alt|title|width|height|align|name]&#39; }&quot;)]
public class TinyMceExtendedValidElements
{
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As you can see in above code, our example is pretty simple. We are just telling TinyMCE to allow the iframe tag and some attributes.&lt;/p&gt;

&lt;p&gt;Next, you need to update &lt;code&gt;episerver.config&lt;/code&gt;...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;episerver&amp;gt;
    ... some configuration ... 
    &amp;lt;tinyMCE mergedConfigurationProperties=&quot;valid_elements, extended_valid_elements, invalid_elements, valid_child_elements&quot; /&amp;gt;
&amp;lt;/episerver&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Where Issues Arise&lt;/h2&gt;

&lt;p&gt;After you add the class to your project and update the configuration file, you may notice that the TinyMCE editor doesn&#39;t load. If you open up &lt;a href=&quot;http://fiddler2.com/&quot;&gt;Fiddler&lt;/a&gt; or your browser&#39;s developer tool utility, you can see a 404 error is thrown for a particular JavaScript file.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/EPiServerTinyMCE/EPiServerTinyMCE_Error1a.PNG&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/EPiServerTinyMCE/EPiServerTinyMCE_Error1b.PNG&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The browser is looking for a file in the path &lt;code&gt;/util/Editor/tinymce/plugins//editor_plugin.js&lt;/code&gt;. The &lt;code&gt;//&lt;/code&gt; hints that something is missing, and that something is the plug-in name. So from here, we can update our class to include the PlugInName...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[TinyMCEPluginNonVisual(PlugInName = &quot;TinyMceExtendedValidElements&quot;, AlwaysEnabled = true, EditorInitConfigurationOptions = &quot;{ extended_valid_elements: &#39;iframe[src|frameborder=0|alt|title|width|height|align|name]&#39; }&quot;)]
public class TinyMceExtendedValidElements
{
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And when we build the project and refresh the browser, we can see the exact path that TinyMCE needs:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/images/EPiServerTinyMCE/EPiServerTinyMCE_Error2.PNG&quot; /&gt;&lt;/p&gt;

&lt;p&gt;But now the issue is that we don&#39;t have a file at that location, and in fact, we don&#39;t need one. &lt;a href=&quot;http://tedgustaf.com&quot;&gt;Ted Nyberg&lt;/a&gt; used to &lt;a href=&quot;http://tedgustaf.com/blog/2011/4/upgrading-to-episerver-cms-6-r2/&quot;&gt;a good workaround&lt;/a&gt; to solve this... Simply use an empty file handler to serve up a blank file. Here is the code for our empty file handler:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;public class EmptyFileHandler : IHttpHandler
{
    public bool IsReusable
    {
        get { return true; }
    }

    public void ProcessRequest(HttpContext context)
    {
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then to hook this up, just add this configuration to &lt;code&gt;web.config&lt;/code&gt; that only targets the path that TinyMCE is looking for:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;configuration&amp;gt;
    ... some configuration ... 
    &amp;lt;location path=&quot;util/editor/tinymce/plugins&quot;&amp;gt;
        &amp;lt;system.webServer&amp;gt;
            &amp;lt;handlers&amp;gt;
                &amp;lt;add name=&quot;TinyMceExtendedValidElements&quot; path=&quot;/util/editor/tinymce/plugins/TinyMceExtendedValidElements/editor_plugin.js&quot; verb=&quot;GET&quot; type=&quot;MyEPiServerProject.Business.Handlers.EmptyFileHandler, MyEPiServerProject&quot; /&amp;gt;
            &amp;lt;/handlers&amp;gt;
        &amp;lt;/system.webServer&amp;gt;
    &amp;lt;/location&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And there we have it! Now TinyMCE will stop removing iframe tags from the saved content.&lt;/p&gt;

&lt;p&gt;From here, you can simply update the parameter in the &lt;code&gt;TinyMCEPluginNonVisual&lt;/code&gt; attribute on the class to allow any other tags and attributes that you need to support in your content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.frederikvig.com/2010/10/how-to-add-support-for-iframes-and-other-elements-to-tinymce-in-episerver-cms/&quot;&gt;How to add support for iframes (and other elements) to TinyMCE in EPiServer CMS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://tedgustaf.com/blog/2011/4/upgrading-to-episerver-cms-6-r2/&quot;&gt;Experiences from upgrading to EPiServer CMS 6 R2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</summary>
    </entry>    <entry>
        <title>Clone a purchase order and convert into cart</title>
        <link href="http://kkhan-episerver.blogspot.com/2013/04/clone-purchase-order-and-convert-into_15.html" />
        <id>http://kkhan-episerver.blogspot.com/2013/04/clone-purchase-order-and-convert-into_15.html</id>
        <updated>2013-04-15T09:38:00.0000000Z</updated>
        <summary type="html">&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;We have a requirement for our client that he can&amp;nbsp;masquerade&amp;nbsp;user and can create a new cart based on some existing Purchase Order(e.g. for damaged/lost orders). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Option 1: Get The OrderForm and other objects from PurchaseOrder and assign it to new Cart.&lt;br /&gt;It did not work as result was a nasty output. On saving Purchase Order for new cart, OrderForm from Parent was assigned to new cart and parent Purchase order lost its associated OrderForms.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Option 2:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Clone the Purchase Order and create a cart based on that but it will not work because. (I tested this with EpiServer Commerce R2SP2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 115%;&quot;&gt;Type &#39;Mediachase.Commerce.Orders.&lt;span style=&quot;color: red;&quot;&gt;PurchaseOrder&lt;/span&gt;&#39; in Assembly &#39;Mediachase.Commerce, Version=5.2.628.0, Culture=neutral, PublicKeyToken=6e58b501b34abce3&#39; is &lt;span style=&quot;color: red;&quot;&gt;not marked as serializable&lt;/span&gt;.&lt;/span&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Solution:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;We can clone OrderForms and OrderAddresses. Therefore I created a clone copy of OrderForm and order addresses and added that into the Cart. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;Below piece of code helped me to&amp;nbsp;achieve&lt;/span&gt;&amp;nbsp;this. Note I have not tested/run workflows.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Cart&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; mycart = &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.GetCart(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;replacementcart&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;SecurityContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.Current.CurrentUserId);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CopyCart(mycart, Order);&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;//Delete and added a new Payment(Zero Charged)&lt;br /&gt;//Convert into Purchase Order&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;///&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt; Copy cart&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&amp;lt;param name=&quot;_cart&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: grey; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&amp;lt;param name=&quot;orderGroup&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; CopyCart(&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;Cart&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; _cart, &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;PurchaseOrder&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; orderGroup)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Initial validation&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (_cart == &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;throw&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;ArgumentNullException&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;_cart&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (orderGroup == &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;throw&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;ArgumentNullException&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;&quot;orderGroup&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// need to set meta data context before cloning&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;MetaDataContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.DefaultCurrent = &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.MetaDataContext;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderForm&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; of = orderGroup.OrderForms[0].Clone() &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderForm&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Remove existing Order Forms&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; i = _cart.OrderForms.Count-1 ; i&amp;gt;=0;i--)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.OrderForms[i].Delete();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;//Add order Forms to basket from PurchasOrder.&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.OrderForms.Add(of);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: green; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;// Remove existing Order Addresses&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; i = _cart.OrderAddresses.Count-1 ; i&amp;gt;=0;i--)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.OrderAddresses[i].Delete();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderAddress&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; address &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; orderGroup.OrderAddresses)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;MetaDataContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.DefaultCurrent = &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderContext&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;.MetaDataContext;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderAddress&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; oa = address.Clone() &lt;/span&gt;&lt;span style=&quot;background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;&quot;&gt;OrderAddress&lt;/span&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.OrderAddresses.Add(oa);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.SetParent(_cart);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.AddressId = orderGroup.AddressId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.AffiliateId = orderGroup.AffiliateId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.ApplicationId = orderGroup.ApplicationId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.BillingCurrency = orderGroup.BillingCurrency;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.CustomerId = orderGroup.CustomerId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.CustomerName = orderGroup.CustomerName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_cart.ProviderId = orderGroup.ProviderId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.Status = orderGroup.Status;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.Owner = orderGroup.Owner;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.OwnerOrg = orderGroup.OwnerOrg;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.ShippingTotal = orderGroup.ShippingTotal;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;_cart.SiteId = orderGroup.SiteId;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.SubTotal = orderGroup.SubTotal;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.TaxTotal = orderGroup.TaxTotal;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.Total = orderGroup.Total;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _cart.AcceptChanges();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;</summary>
    </entry>    <entry>
        <title>Pattern for EPiServer block preview MVC controller</title>
        <link href="http://joelabrahamsson.com/pattern-for-episerver-block-preview-mvc-controller/" />
        <id>http://joelabrahamsson.com/pattern-for-episerver-block-preview-mvc-controller/</id>
        <updated>2013-04-15T08:26:49.0000000Z</updated>
        <summary type="html">&lt;pre class=&quot;prettyprint&quot;&gt;using System.Web.Mvc;
using EPiServer.Core;
using EPiServer.Framework.DataAnnotations;
using EPiServer.Framework.Web;
using EPiServer.Web;

namespace MySite
{
    [TemplateDescriptor(
        Inherited = true,
        TemplateTypeCategory = TemplateTypeCategories.MvcController,
        Tags = new [] { RenderingTags.Preview },
        AvailableWithoutTag = false)]
    public class PreviewController : Controller, IRenderTemplate&amp;lt;BlockData&amp;gt;
    {
        public ActionResult Index(IContent currentContent)
        {
            //TODO: Create model suitable for the view and return ViewResult
            return View();
        }
    }
}&lt;/pre&gt;
&lt;p&gt;Explained:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;using System.Web.Mvc;
using EPiServer.Core;
using EPiServer.Framework.DataAnnotations;
using EPiServer.Framework.Web;
using EPiServer.Web;

namespace MySite
{
    [TemplateDescriptor(
        //Support everything inheriting from BlockData.
        Inherited = true,
        //By default controllers implementing IRenderTemplate&amp;lt;T&amp;gt; where T is BlockData
        //are registered as partial renderers. As this will be a &quot;full page&quot; renderer
        //we need to change that.
        TemplateTypeCategory = TemplateTypeCategories.MvcController,
        //Should only be used for preview
        Tags = new [] { RenderingTags.Preview },
        AvailableWithoutTag = false)]
    public class PreviewController : Controller,
        //Register as template for BlockData. To only support a specific type
        //change the type parameter from BlockData to that type and optionally
        //set Inherited = false in the the TemplateDescriptor attribute above.
        IRenderTemplate&amp;lt;BlockData&amp;gt;
    {
        public ActionResult Index(
            //While we implement IRenderTemplate for BlockData model binding
            //can only deal with IContent, ie shared blocks in this case.
            IContent currentContent
            )
        {
            //TODO: Create model suitable for the view and return ViewResult
            return View();
        }
    }
}&lt;/pre&gt;
</summary>
    </entry>    <entry>
        <title>Hiding EPiServer properties from editors</title>
        <link href="http://joelabrahamsson.com/hiding-episerver-properties-from-editors/" />
        <id>http://joelabrahamsson.com/hiding-episerver-properties-from-editors/</id>
        <updated>2013-04-14T14:10:08.0000000Z</updated>
        <summary type="html">&lt;p&gt;When managing a property in EPiServer&#39;s admin mode there is a setting named &quot;&lt;strong&gt;Display in Edit Mode&lt;/strong&gt;&quot;. To control this setting from code in EPiServer 7 use the&amp;nbsp;&lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;ScaffoldColumn&lt;/span&gt;&lt;/strong&gt; attribute.&lt;/p&gt;
&lt;p&gt;When set to false it will hide the property from editors, meaning that while they may seem the rendered value in preview mode they won&#39;t see a blue box around it and they won&#39;t be able to click on the property to edit it. The property won&#39;t be visible in forms editing mode either.&lt;/p&gt;
&lt;p&gt;There is also the &lt;strong&gt;&lt;span class=&quot;code-concept&quot;&gt;Editable&lt;/span&gt;&lt;/strong&gt; attribute. When this is set to false the property will still be visible to editors in both preview mode, with a blue box around it, and in forms editing mode. The editor for it will however be disabled, meaning that while editors can inspect the property&#39;s value they can&#39;t modify it.&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Working with Localization and Language Branches in EPiServer 7 MVC</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/11/working-with-localization-and-language-branches-in-episerver-7-mvc" />
        <id>http://cjsharp1.github.io/blog/2013/04/11/working-with-localization-and-language-branches-in-episerver-7-mvc</id>
        <updated>2013-04-12T02:40:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;One powerful feature that EPiServer 7 provides is the localization of page content and the creation of language branches for your site, which allows you to create a multi-language, international site without the need for a huge amount of work. In this post, we&#39;ll look at how to configure, utilize, and develop for localization in EPiServer 7.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;Languages Branches in Edit Mode&lt;/h2&gt;

&lt;p&gt;When comparing to previous versions of EPiServer, the latest release of EPiServer 7 has dramatically changed the way you work with language branches in Edit Mode. While some may think this new approach is taking a step backwards, it definitely takes a bit more steps to add a language branch to a page. But at the same time, it provides better organization when working with multi-site EPiServer applications.&lt;/p&gt;

&lt;h3&gt;Adding Languages&lt;/h3&gt;

&lt;p&gt;Let&#39;s first start with adding languages. This part has not changed between EPiServer 6 CMS and EPiServer 7. In Admin Mode, under the Config tab, you&#39;ll find the &quot;Manage Website Languages&quot; page. On this page, you can add a new language, enable/disable languages, and set access rights for a language branch. One thing to note that the access rights in the area only control which languages editors/administrators can work with in Edit Mode. It does not affect access rights on the visitor&#39;s side.&lt;/p&gt;

&lt;p&gt;Also, the list of languages that you can add is generated from the .NET Framework&#39;s &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo%28v=vs.80%29.aspx&quot;&gt;CultureInfo class in the System.Globalization namespace&lt;/a&gt;, and only contains the language codes that adhere to the RFC 1766 standard. If you want to add a custom language code, you&#39;ll need to add a custom culture, and this culture will need to be added on any server the site lives on.&lt;/p&gt;

&lt;h3&gt;Making Languages Available&lt;/h3&gt;

&lt;p&gt;After all the languages you want to support are added and enabled, you need to make them available in Edit Mode. Click on the Root Page of your EPiServer site, go into Forms Editing mode, click the &quot;Tools&quot; dropdown, and select &quot;Language Settings&quot;. Click the &quot;Change&quot; button in the &quot;Available Languages&quot; section, check all of the languages you want to make available for editing, then click &quot;Save&quot;. If you already have a Start Page set up and configured, you may need to do the same steps on the Start Page.&lt;/p&gt;

&lt;h3&gt;Changing the Master Language&lt;/h3&gt;

&lt;p&gt;If you want to change the master language for the site, you don&#39;t necessarily need to worry about this in EPiServer 7, primarily because you no longer need the Root Page to be in the same language branch as your master language. After you add, enable, and make available the language branches you want to use, just assign the &quot;master&quot; language to the host name, and switch to that language branch. If you have previously created pages in the old &quot;master&quot; language, you can just remove them then disable that language branch.&lt;/p&gt;

&lt;h3&gt;Adding a Page to a Language Branch&lt;/h3&gt;

&lt;p&gt;The biggest change between EPiServer 6 CMS and EPiServer 7 is the steps needed to switch from one language branch to another in order to add a new page:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the navigation pane&lt;/li&gt;
&lt;li&gt;Click the &quot;Sites&quot; tab&lt;/li&gt;
&lt;li&gt;Click the &quot;Settings&quot; button (the little cog) in the bottom right of the navigation pane and choose &quot;Show All Languages&quot; (you might be able to skip this step if you are using EPiServer 7.1)&lt;/li&gt;
&lt;li&gt;Expand the current site and select the language you want (Edit Mode will reload)&lt;/li&gt;
&lt;li&gt;Open the navigation pane again&lt;/li&gt;
&lt;li&gt;Click the &quot;Settings&quot; button (the little cog) in the bottom right and select &quot;Show All Languages&quot;&lt;/li&gt;
&lt;li&gt;Click the page in the other language and click the button &quot;Translate&quot;&lt;/li&gt;
&lt;li&gt;Edit the page&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I find it useful to pin the navigation pane open when working on sites with multiple languages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you are using EPiServer 7.1, the &quot;Show All Languages&quot; text has been switched to say &quot;Show Content Not in &lt;em&gt;{insert your current language}&lt;/em&gt;&quot;. Also, the flow of language handling has been improved (see below).&lt;/p&gt;

&lt;h3&gt;Translating Blocks and Their Folders (added in EPiServer 7.1)&lt;/h3&gt;

&lt;p&gt;Much like translating pages, with the release of EPiServer 7.1, you can now translate blocks and the folders they live in. &lt;a href=&quot;/link/976fea2756744165b944e4b4ede9e4a7.aspx?id=66142&amp;amp;epslanguage=en&quot;&gt;From the release notes:&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Now you can translate blocks and their folders in the same way as for pages with the option Show All Languages for the shared blocks gadget. This option will show blocks and folders for all languages. Not translated blocks have a language code representing the fallback language, when this is turned off only blocks and folders that are available for the current language will be shown.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;Edit Mode &quot;View As&quot; Settings (added in EPiServer 7.1)&lt;/h3&gt;

&lt;p&gt;Also added in EPiServer 7.1 is the improved flow of language handling, which added a new option to the view settings. When you click the &quot;Toggle view settings&quot; button (the little eye) in Edit Mode, you&#39;ll see a new option with your current language branch.&lt;/p&gt;

&lt;p&gt;Clicking that will open the &quot;View in this language&quot; dropdown with all enabled languages for the site. When you select one of those languages, it will display the currently viewed page in the selected language, though it will not switch completely to that language branch. If the page does not exist in the selected language, it will give you direct link to translate it, which will switch Edit Mode to that language branch.&lt;/p&gt;

&lt;h2&gt;Language Provider Configuration&lt;/h2&gt;

&lt;p&gt;In EPiServerFramework.config, you can configure the location of your language files, the fallback behavior, and the fallback culture:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;localization fallbackBehavior=&quot;Echo, MissingMessage, FallbackCulture&quot; fallbackCulture=&quot;en-US&quot;&gt;&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;&amp;lt;providers&amp;gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &amp;lt;add virtualPath=&quot;~/Resources/LanguageFiles&quot; name=&quot;languageFiles&quot; type=&quot;EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider, EPiServer.Framework&quot; /&amp;gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/providers&amp;gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;&amp;lt;/localization&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Notice in the configuration the values in the &lt;code&gt;fallbackBehavior&lt;/code&gt; attribute. There are four possible values available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Echo&lt;/strong&gt; - If no match for the key is found, and if the key does not start with a &#39;#&#39; or a &#39;/&#39;, it will return back the key unmodified.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MissingMessage&lt;/strong&gt; - If no match for the key is found, it will return a message stating that the resource could not be found.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;FallbackCulture&lt;/strong&gt; - If no match for the key is found, it will attempt to return the resource from the culture specified in the &lt;code&gt;fallbackCulture&lt;/code&gt; attribute.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;None&lt;/strong&gt; - If no match for the key is found, nothing will be returned.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If you would like to use a custom localization provider, check out &lt;a href=&quot;https://world.episerver.com/Documentation/HTML-Documentation/?path=/SdkDocuments/episerverframework/7/Knowledge%20Base/Developer%20Guide/Localization/CustomLocalizationProvider.htm&amp;amp;vppRoot=/SdkDocuments//episerverframework/7/Knowledge%20Base/Getting%20Started/&quot;&gt;this page in the EPiServer documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Linking to Another Language Branch&lt;/h2&gt;

&lt;p&gt;Getting your visitors to a different language branch has became much easier with EPiServer 7 MVC. You just need to provide the language code to the route data.&lt;/p&gt;

&lt;p&gt;For example, in your front-end views (using Razor):&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;@Html.PageLink(&quot;Link Text&quot;, pageData.PageLink, new { language = &quot;sv-SE&quot; }, null)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Or your back-end code:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;return RedirectToAction(&quot;Index&quot;, new { language = &quot;sv-SE&quot; });&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;h2&gt;Back-End Localization&lt;/h2&gt;

&lt;p&gt;To access localization data from the back-end code, use an instance of the &lt;code&gt;LocalizationService&lt;/code&gt;, which is part of the &lt;code&gt;EPiServer.Framework.Localization&lt;/code&gt; namespace.&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;var translatedValue = LocalizationService.Current.GetString(&quot;/sometemplate/somevalue&quot;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Other methods in this class allow you to return all localization keys available, or to return localization data for a specified culture. I recommend checking out the &lt;a href=&quot;http://sdkbeta.episerver.com/Class-Library/EPiServerFramework/RenderPage/?documentId=episerverframework/7/d2290188-6b17-9f90-1d66-6d9d7bc0950e&quot;&gt;LocalizationService class in the EPiServer 7 SDK&lt;/a&gt; when it comes to finding the right method for your needs.&lt;/p&gt;

&lt;p&gt;From the back-end, you can also override the &lt;code&gt;fallbackBehavior&lt;/code&gt; language provider configuration attribute directly in the method from the &lt;code&gt;LocalizationService&lt;/code&gt; instance. For example, if you do not want to show any fallback text, you can pass in &lt;code&gt;FallbackBehaviors.None&lt;/code&gt; as a parameter:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;var translatedValue = LocalizationService.Current.GetString(&quot;/sometemplate/somevalue&quot;, FallbackBehaviors.None);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, if you want to directly specify the fallback text, you can just pass in a string:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;var translatedValue = LocalizationService.Current.GetString(&quot;/sometemplate/somevalue&quot;, &quot;Fallback String&quot;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;h2&gt;Front-End Localization&lt;/h2&gt;

&lt;p&gt;To access localization data from the front-end view (in our case, using Razor), use the &lt;code&gt;Translate&lt;/code&gt; helper, which is a provided EPiServer MVC HTML helper:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;@Html.Translate(&quot;/sometemplate/somevalue&quot;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;You could also use the &lt;code&gt;TranslateFallback&lt;/code&gt; helper, which will return a supplied fallback string if no match is found:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;@Html.TranslateFallback(&quot;sometemplate/somemissingvalue&quot;, &quot;Missing a translation&quot;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;EPiServer has also created some HTML helpers that can generate HTML for forms, such as the &lt;code&gt;TranslatedButton&lt;/code&gt;, &lt;code&gt;TranslatedLabel&lt;/code&gt;, and &lt;code&gt;TranslatedTextBox&lt;/code&gt; helpers.&lt;/p&gt;

&lt;h2&gt;Language Files&lt;/h2&gt;

&lt;p&gt;More than likely, you&#39;ll create custom language files for your application, either to store translated text used in Edit Mode for editors in different cultures, or in the view for visitors in different parts of the world.&lt;/p&gt;

&lt;h3&gt;The Old &#39;lang&#39; Folder&lt;/h3&gt;

&lt;p&gt;With the release of EPiServer 7, the system localization normally stored in the &#39;lang&#39; folder have disappeared. &lt;a href=&quot;http://sdkbeta.episerver.com/SDK-html-Container/?path=/SdkDocuments/EPiServerFramework/7/Knowledge%20Base/Developer%20Guide/Localization/Replacing%20LanguageManager%20with%20LocalizationService.htm&amp;amp;vppRoot=/SdkDocuments//EPiServerFramework/7/Knowledge%20Base/Developer%20Guide/&quot;&gt;The documentation explains what happened to them:&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Though strictly not needed, the lang folder under the web directory will continue to work as before and any language XML files placed here will be read by a default localization provider that is added automatically. If you do not wish for this to happen, you can just remove the folder or set the value of the addDefaultProvider attribute of the resources element to false.&lt;/p&gt;

&lt;p&gt;If you want to override the system localizations that are shipped with EPiServer products, you will notice that the language files are no longer installed in the lang folder. They are now instead embedded in the assemblies but just as before you can override individual string by placing your own language XML in the lang folder. Of course you can include your localizations through any other LocalizationProvider and they will take precedence over the system localizations as long as the provider is registered before the system ones.&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;Our Custom Language Files&lt;/h3&gt;

&lt;p&gt;In the above configuration file, we specified our location of the language file. At this location, you just need to add (one or many) XML files to hold the values. Any XML files you add here needs to have the XML declaration, followed by the parent &lt;code&gt;&amp;lt;languages&amp;gt;&lt;/code&gt; node which contains (one or many) &lt;code&gt;&amp;lt;language&amp;gt;&lt;/code&gt; nodes for each language code (that matches the language branch):&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;languages&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;  &amp;lt;language name=&quot;English (United States)&quot; id=&quot;en-US&quot;&gt;&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;&amp;lt;sometemplate&amp;gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    &amp;lt;somevalue&amp;gt;Translated Value&amp;lt;/somevalue&amp;gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/sometemplate&amp;gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;  &amp;lt;/language&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/languages&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Aside from the &lt;code&gt;&amp;lt;languages&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;language&amp;gt;&lt;/code&gt; nodes, there are no naming standard you need to follow when naming the custom keys or the XML files. So as you can imagine, you could either put all translated values for all languages in one XML file, or you could split it up into many XML files so it&#39;s better organized.&lt;/p&gt;

&lt;p&gt;The one exception to this is when you are trying to localize the text in Edit Mode. Unfortunately, it is not thoroughly documented what the names of the keys should be, though there has been a couple blog posts that has helped shed some light on these values. For more information on this, I&#39;ve found these resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://world.episerver.com/Blogs/Per-Nergard/Dates/2013/3/EPiServer-localization-xml-files-structure/&quot;&gt;EPiServer localization xml files structure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://tedgustaf.com/blog/2012/11/localization-of-block-type-names-in-episerver-7/&quot;&gt;Localization of block type names in EPiServer 7&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If you still cannot find the necessary names for the keys, the best solution is just look at the source code using a decompiler/reflector tool. I had to do this when I was trying to figure out how to localize error messages generated from an XForm property.&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>A Closer Look at the AvailablePageTypes Attribute in EPiServer 7</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/11/a-closer-look-at-the-availablepagetypes-attribute-in-episerver-7" />
        <id>http://cjsharp1.github.io/blog/2013/04/11/a-closer-look-at-the-availablepagetypes-attribute-in-episerver-7</id>
        <updated>2013-04-12T02:35:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;I was recently looking into how to fully use the &lt;code&gt;[AvailablePageTypes]&lt;/code&gt; attribute in my page models, and after a bit of research and reading the &lt;a href=&quot;http://sdkbeta.episerver.com/SDK-html-Container/?path=/SdkDocuments/CMS/7/Knowledge%20Base/Developer%20Guide/Content/Pages%20and%20Blocks/Attributes.htm&amp;amp;vppRoot=/SdkDocuments//CMS/7/Knowledge%20Base/Developer%20Guide/&quot;&gt;sometimes confusing documentation&lt;/a&gt;, and the &lt;a href=&quot;http://world.episerver.com/Documentation/Class-library/?documentId=cms/7/a9aede9a-696b-26b9-aeb9-338e7516f308&quot;&gt;less confusing class documentation&lt;/a&gt;, I found it has some interesting and helpful features. Let&#39;s take a closer look at this attribute.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;Using the Attribute&lt;/h2&gt;

&lt;p&gt;As you could guess, this attribute is used to specify which page types can or cannot be created under an instance of a specific page type. This is an optional attribute, but it can drastically help organize the &#39;Create New Page&#39; screen, while also preventing editors from creating pages in the wrong area. This attribute is not supported on block models.&lt;/p&gt;

&lt;h3&gt;Availability&lt;/h3&gt;

&lt;p&gt;The first parameter in the attribute is &lt;strong&gt;Availability&lt;/strong&gt;. This parameter takes one value from the &lt;code&gt;Availability&lt;/code&gt; enum found in the &lt;code&gt;EPiServer.DataAbstraction.PageTypeAvailability&lt;/code&gt; namespace. There are four possible options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;All&lt;/strong&gt; - This specifies that all page types will be available to be created under a page instance. This is the default value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;None&lt;/strong&gt; - This specifies that no page types will be available to be created under a page instance. If this value is set, all other settings on the attribute are ignored.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Specific&lt;/strong&gt; - This specifies that only the selected page types will be created under a page instance. This value makes more sense when configuring available page types in Admin Mode. (My guess is that when any of the other settings on the attribute is set, this value gets auto-selected.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Undefined&lt;/strong&gt; - You shouldn&#39;t use this, as it&#39;s not even an option in Admin Mode.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Include and Exclude&lt;/h3&gt;

&lt;p&gt;The two most common parameters for this attribute are &lt;strong&gt;Include&lt;/strong&gt; and &lt;strong&gt;Exclude&lt;/strong&gt;, both of which require an array of Types. One common example would be on a Start Page model:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;[ContentType(GUID = &quot;49754310-E0ED-4C95-AA69-C155323E0AA9&quot;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[AvailablePageTypes(&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;Include = new Type[]{ typeof(StandardPage), typeof(ListPage) },
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;Exclude = new Type[]{ typeof(StartPage), typeof(SettingsPage) }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public class StartPage : PageData
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;In this page model, we are saying that we will allow any pages of type &lt;code&gt;StandardPage&lt;/code&gt; and &lt;code&gt;ListPage&lt;/code&gt; to be created, and we will not allow any pages of type &lt;code&gt;StartPage&lt;/code&gt; or &lt;code&gt;SettingsPage&lt;/code&gt; to be created.&lt;/p&gt;

&lt;p&gt;Pretty simple and straightforward in my opinion.&lt;/p&gt;

&lt;h3&gt;IncludeOn and ExcludeOn&lt;/h3&gt;

&lt;p&gt;These parameters were a bit tricky to understand at first, primarily because the explanation in the documentation is a little confusing.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://sdkbeta.episerver.com/SDK-html-Container/?path=/SdkDocuments/CMS/7/Knowledge%20Base/Developer%20Guide/Content/Pages%20and%20Blocks/Attributes.htm&amp;amp;vppRoot=/SdkDocuments//CMS/7/Knowledge%20Base/Developer%20Guide/&quot;&gt;The documentation states:&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;IncludedOn differs from Include in the way that it is not excluding. That is. for types in IncludedOn that has all page types available no page types will be excluded. Include on the other hand will exclude all typed pages except the ones given in Include.&lt;/p&gt;

&lt;p&gt;Excluded works so that if no types are set on Included then the result will be that all registered page types except the Excluded ones are available. If there are types registered in Included then all types in Included except the ones in Excluded are available. Below is an image that shows how Excluded and ExcludedOn are mapped to settings in admin mode.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This is how I see it:&lt;/p&gt;

&lt;p&gt;You would use &lt;code&gt;IncludeOn&lt;/code&gt; to specify that the current page type can be created under the specified page type(s). So for our example, we could use the &lt;code&gt;IncludeOn&lt;/code&gt; parameter in the &lt;code&gt;StandardPage&lt;/code&gt; to specify that it can be created under any page instance the &lt;code&gt;StartPage&lt;/code&gt; page type:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;[ContentType(GUID = &quot;49754310-E0ED-4C95-AA69-C155323E0AA9&quot;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[AvailablePageTypes(&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;IncludeOn = new Type[]{ typeof(StartPage) }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public class StandardPage : PageData
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Similarly, you would use &lt;code&gt;ExcludeOn&lt;/code&gt; to specify that the current page type can not be created under the specified page type(s). So for our example, we could the the &lt;code&gt;ExcludeOn&lt;/code&gt; parameter in the &lt;code&gt;SettingsPage&lt;/code&gt; to specify that is can not be created under any page instance of the &lt;code&gt;StartPage&lt;/code&gt; page type:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;[ContentType(GUID = &quot;49754310-E0ED-4C95-AA69-C155323E0AA9&quot;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[AvailablePageTypes(&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;ExcludeOn = new Type[]{ typeof(SettingsPage) }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public class SettingsPage : PageData
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;So think of these parameters as a vice-versa of &lt;code&gt;Include&lt;/code&gt; and &lt;code&gt;Exclude&lt;/code&gt;. By using these parameters, you can keep the array of Types short and concise, while also reducing the need to go back and revise the &lt;code&gt;Include&lt;/code&gt; or &lt;code&gt;Exclude&lt;/code&gt; Type arrays of the other page model.&lt;/p&gt;

&lt;h3&gt;How the Attributes are Applied&lt;/h3&gt;

&lt;p&gt;With this attribute potentially spread across all of your page models, you might start finding yourself either conflicting or being redundant with your &lt;code&gt;Include&lt;/code&gt;, &lt;code&gt;IncludeOn&lt;/code&gt;, &lt;code&gt;Exclude&lt;/code&gt;, and &lt;code&gt;ExcludeOn&lt;/code&gt; parameters.&lt;/p&gt;

&lt;p&gt;If that&#39;s the case, keep in mind how the attributes are applied:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Include&lt;/code&gt; implicitly excludes all page types not in the list&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Exclude&lt;/code&gt; implicitly includes all page types not in the list&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IncludeOn&lt;/code&gt; and &lt;code&gt;ExcludeOn&lt;/code&gt; combine with the settings on the target page type&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;If there is a conflict, &lt;code&gt;Exclude&lt;/code&gt; and &lt;code&gt;ExcludeOn&lt;/code&gt; have priority over &lt;code&gt;Include&lt;/code&gt; and &lt;code&gt;IncludeOn&lt;/code&gt;.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

</summary>
    </entry>    <entry>
        <title>Turn Your EPiServer 7 MVC Page/Block Model into a View Model using the Ignore Attribute</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/11/turn-your-episerver-7-mvc-page-slash-block-model-into-a-view-model-using-the-ignore-attribute" />
        <id>http://cjsharp1.github.io/blog/2013/04/11/turn-your-episerver-7-mvc-page-slash-block-model-into-a-view-model-using-the-ignore-attribute</id>
        <updated>2013-04-12T02:28:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;If you&#39;ve ever built a large MVC application, you&#39;ll know that your project can sometimes contain a large amount of files, some of which act as a layer of code between two aspects of the application. One such file is the view model, which is used to transfer data from the controller to the view.&lt;/p&gt;

&lt;p&gt;When developing with EPiServer 7 MVC, in most situations you can use the page or block model directly in your view. There are some cases, however, where you&#39;ll find yourself using a separate view model to satisfy the needs of the view.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;h2&gt;An Example&lt;/h2&gt;

&lt;p&gt;For example, say you have a page model with a &lt;code&gt;LinkItemCollection&lt;/code&gt; property, but the view needs a &lt;code&gt;List&lt;/code&gt; of a particular page type. You could easily create two files for this, the page model and the view model:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Page Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;[ContentType(GUID = &quot;49754310-E0ED-4C95-AA69-C155323E0AA9&quot;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public class ListPage : PageData
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;public virtual LinkItemCollection PageCollection { get; set; }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;public class ListPageViewModel
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;public List&amp;lt;SimplePage&amp;gt; PageList{ get; set; }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;However, you can simplify this into one file by using the &lt;code&gt;[Ignore]&lt;/code&gt; attribute on the property. The &lt;code&gt;[Ignore]&lt;/code&gt; attribute prevents EPiServer from registering the property as an editable page/block type property.&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;[ContentType(GUID = &quot;49754310-E0ED-4C95-AA69-C155323E0AA9&quot;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public class ListPage : PageData
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;public virtual LinkItemCollection PageCollection { get; set; }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[Ignore]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public virtual List&amp;lt;SimplePage&amp;gt; PageList{ get; set; }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;h2&gt;Why Use This?&lt;/h2&gt;

&lt;p&gt;While I completely understand that some people may disagree with this idea (&lt;a href=&quot;http://joelabrahamsson.com/episerver-and-mvc-what-is-the-view-model/&quot;&gt;primarily because of the many benefits that the view model provides&lt;/a&gt;), I&#39;ve found this useful particularly for a couple reasons:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fewer lines of code by eliminating edit hints&lt;/strong&gt; - By turning the page/block model into a view model, you don&#39;t need to add on-page editing hints in the &lt;code&gt;ViewData&lt;/code&gt; in your controller:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;var editHints = this.ViewData.GetEditHints&amp;lt;ListPageViewModel, ListPage&gt;();
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;editHints.AddConnection(vm =&gt; vm.PageList, pm =&gt; pm.PageCollection);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Instead, you can use EPiServer&#39;s &lt;code&gt;EditAttributes&lt;/code&gt; HTML helper, and use on the properties in the page/block model to provide the proper on-page editing:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;@model ListPage&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;div @Html.EditAttributes(m =&gt; m.PageCollection)&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    @foreach (var page in Model.PageList)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        ... some code ...
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/div&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fewer files to maintain by eliminating a layer of code&lt;/strong&gt; - By using the &lt;code&gt;[Ignore]&lt;/code&gt; attribute, you can look at the page/block model and see exactly what the view needs, whether the property is for editing purposes or for displaying purposes. This also makes it easier to update or maintain the code in future changes.&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Creating a XForm Block in EPiServer 7 MVC with Working Validation (Updated)</title>
        <link href="http://cjsharp1.github.io/blog/2013/04/11/creating-a-xform-block-in-episerver-7-mvc-with-working-validation-updated" />
        <id>http://cjsharp1.github.io/blog/2013/04/11/creating-a-xform-block-in-episerver-7-mvc-with-working-validation-updated</id>
        <updated>2013-04-12T02:11:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;I initially posted &lt;a href=&quot;http://blog.nansen.com/2013/03/creating-xform-block-in-episerver-7-mvc.html&quot;&gt;this solution on the Nansen blog&lt;/a&gt;, but since then the code has been updated for both bug fixes and to reduce unnecessary layers (at least, unnecessary for my situation).&lt;/p&gt;

&lt;p&gt;With the flexibility that block types offer in EPiServer 7, it would make sense that one common feature that people would want is an XForm in a block, so editors can freely add, move, and reuse blocks with forms around their website. In a recent project, this was one of my requirements.&lt;/p&gt;

&lt;!-- more --&gt;


&lt;p&gt;Although a solution for making XForms to work inside a block type has been partially solved, it doesn&#39;t fully support validation, which is a common requirement. Also, the documentation is still lacking when it comes to explaining how to integrate XForms in EPiServer 7 MVC, both within a page type and a block type.&lt;/p&gt;

&lt;p&gt;This solution was developed using the initial release of EPiServer 7. The EPiServer support team has stated that they may implement a solution for fully working XForms in a block on a future release.&lt;/p&gt;

&lt;h2&gt;The Solution&lt;/h2&gt;

&lt;p&gt;The solution to this revolved heavily around making sure the action URL on the form was correct (so we stay on the page the the block is located) and sharing the controller&#39;s &lt;code&gt;ViewData&lt;/code&gt; with all controllers that needed it (both page controllers and block controllers).&lt;/p&gt;

&lt;h3&gt;/Models/Blocks/XFormBlock.cs&lt;/h3&gt;

&lt;p&gt;This is the block class with the XForm block. By decorating the &lt;code&gt;ActionUri&lt;/code&gt; property with the &lt;code&gt;[Ignore]&lt;/code&gt; attribute, we can treat this class also as the view model for the view. The &lt;code&gt;[Ignore]&lt;/code&gt; attribute prevents EPiServer from registering the property as an editable block type property.&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;[ContentType(GUID = &quot;49754310-E0ED-4C95-AA69-C155323E0AA9&quot;)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public class XFormBlock : BlockData
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;[Display(GroupName = SystemTabNames.Content)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public virtual XForm Form { get; set; }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[Ignore]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public virtual string ActionUri { get; set; }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;h3&gt;/Controllers/BasePageController.cs&lt;/h3&gt;

&lt;p&gt;This is the most important piece of the solution, since it handles all the XForm actions, as well as sets the &lt;code&gt;ViewData&lt;/code&gt; that&#39;s used in the block controller.&lt;/p&gt;

&lt;p&gt;The first main method that we override is the &lt;code&gt;OnResultExecuting()&lt;/code&gt; method, which sets the &lt;code&gt;ViewData&lt;/code&gt; in the &lt;code&gt;TempData&lt;/code&gt; collection after a page controller sets it. Without this, the block controller will have a different &lt;code&gt;ViewData&lt;/code&gt;, which makes all the validation information go away.&lt;/p&gt;

&lt;p&gt;The second main method we override is &lt;code&gt;OnActionExecuting()&lt;/code&gt;, which handles the transfer of the &lt;code&gt;ViewData&lt;/code&gt; between the XForm methods &lt;code&gt;Success()&lt;/code&gt; and &lt;code&gt;Failed()&lt;/code&gt; to the page controllers they are redirecting to through the &lt;code&gt;RedirectToAction(&quot;Index&quot;)&lt;/code&gt; call.&lt;/p&gt;

&lt;p&gt;When the &lt;code&gt;ViewData&lt;/code&gt; is set, we use a unique key for the form in the &lt;code&gt;TempData&lt;/code&gt; collection. The unique key uses the &lt;code&gt;ContentLink&lt;/code&gt; ID of the block, which is built into the &lt;code&gt;ActionUri&lt;/code&gt; and passed in as a parameter to the &lt;code&gt;XFormPost&lt;/code&gt; method. This unique key allows us to use multiple XForm blocks on the same page without the &lt;code&gt;ViewData&lt;/code&gt; of one block interfering with the &lt;code&gt;ViewData&lt;/code&gt; of another block. The only exception to this is when a page has two instances of the same XForm block (which really doesn&#39;t happen very often). One side benefit of this is that we only transfer the &lt;code&gt;ViewData&lt;/code&gt; when we have the &lt;code&gt;_contentId&lt;/code&gt;, which prevents unnecessary saving and fetching of the &lt;code&gt;ViewData&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;21&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;22&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;23&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;25&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;26&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;27&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;28&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;29&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;31&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;32&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;33&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;34&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;35&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;36&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;37&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;38&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;39&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;40&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;41&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;42&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;43&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;44&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;45&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;46&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;47&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;48&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;49&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;50&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;51&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;52&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;53&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;54&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;55&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;56&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;57&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;58&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;59&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;60&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;61&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;62&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;63&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;64&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;65&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;66&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;67&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;public class BasePageController&amp;lt;T&gt; : PageController&amp;lt;T&gt; where T : PageData
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;private readonly XFormPageUnknownActionHandler _xformHandler;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;private string _contentId;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;private readonly string _viewDataKeyFormat = &quot;ViewData_{0}&quot;;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;private string ViewDataKey
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    get
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        return string.Format(_viewDataKeyFormat, _contentId);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public BasePageController()
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    _xformHandler = new XFormPageUnknownActionHandler();
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    _contentId = string.Empty;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;protected override void OnActionExecuting(ActionExecutingContext filterContext)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    if (!string.IsNullOrEmpty(_contentId))
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        if (TempData[ViewDataKey] != null)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;            ViewData = (ViewDataDictionary)TempData[ViewDataKey];
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    base.OnActionExecuting(filterContext);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;protected override void OnResultExecuting(ResultExecutingContext filterContext)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    if (!string.IsNullOrEmpty(_contentId))
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        TempData[ViewDataKey] = ViewData;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    base.OnResultExecuting(filterContext);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[AcceptVerbs(HttpVerbs.Post)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public virtual ActionResult Success(XFormPostedData xFormPostedData)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    return RedirectToAction(&quot;Index&quot;);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[AcceptVerbs(HttpVerbs.Post)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public virtual ActionResult Failed(XFormPostedData xFormPostedData)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    return RedirectToAction(&quot;Index&quot;);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;[AcceptVerbs(HttpVerbs.Post)]
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;public virtual ActionResult XFormPost(XFormPostedData xFormpostedData, string contentId)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    _contentId = contentId;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    return _xformHandler.HandleAction(this);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;h3&gt;/Controllers/XFormBlockController.cs&lt;/h3&gt;

&lt;p&gt;In the block&#39;s controller, we grab the &lt;code&gt;ViewData&lt;/code&gt; that we saved in the &lt;code&gt;BasePageController&lt;/code&gt; using the same unique key. This allows us to maintain the validation data for the XForm.&lt;/p&gt;

&lt;p&gt;The important part of this is how we build out the &lt;code&gt;ActionUrl&lt;/code&gt;. We can get the &lt;code&gt;currentPage&lt;/code&gt; data from the &lt;code&gt;PageRouteHelper&lt;/code&gt;, then find the virtual path to the page we are viewing using a &lt;code&gt;UrlResolver&lt;/code&gt;, so we always POST to the page that the block is on. We also put the block&#39;s &lt;code&gt;ContentLink&lt;/code&gt; ID in the &lt;code&gt;ActionUri&lt;/code&gt; so the &lt;code&gt;BasePageController&lt;/code&gt; knows how to save the &lt;code&gt;ViewData&lt;/code&gt;. The rest of the values in the query string are to set the actions that the XForm handler uses if the submission was successful or unsuccessful.&lt;/p&gt;

&lt;p&gt;One things to note is that if we are using on-page editing for the block, we won&#39;t have a &lt;code&gt;currentPage&lt;/code&gt;. In this situation, we just borrow the Start Page. This won&#39;t matter anyway, because if you try to click the &quot;Submit&quot; button, rather than the form being submitted, the form selection modal will pop up instead.&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;13&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;14&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;15&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;16&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;17&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;18&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;19&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;20&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;21&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;22&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;23&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;24&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;25&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;26&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;27&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;28&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;29&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;30&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;31&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;32&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;33&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;34&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;35&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;36&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;37&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;38&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;39&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;40&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;41&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;42&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;43&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;44&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;45&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;public class XFormBlockController : BlockController&amp;lt;XFormBlock&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;pre&gt;&amp;lt;code&gt;public override ActionResult Index(XFormBlock currentBlock)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;{
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    var currentBlockID = (currentBlock as IContent).ContentLink.ID;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    var viewDataKey = string.Format(&quot;ViewData_{0}&quot;, currentBlockID);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    if (TempData[viewDataKey] != null)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        ViewData = (ViewDataDictionary)TempData[viewDataKey];
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    var pageRouteHelper = ServiceLocator.Current.GetInstance&amp;lt;PageRouteHelper&amp;gt;();
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    PageData currentPage = pageRouteHelper.Page;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    // For block preview mode, we need to have a current page, 
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    // but since preview isn&#39;t really a page, we&#39;ll use the start page
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    // This won&#39;t matter anyway. If you try to submit the form,
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    // the form selection window will pop up.
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    if (currentPage == null)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        var contentLoader = ServiceLocator.Current.GetInstance&amp;lt;IContentLoader&amp;gt;();
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        currentPage = contentLoader.Get&amp;lt;StartPage&amp;gt;(ContentReference.StartPage);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    if (currentBlock.Form != null &amp;amp;&amp;amp; currentPage != null)
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        var urlResolver = ServiceLocator.Current.GetInstance&amp;lt;UrlResolver&amp;gt;();
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        var pageUrl = urlResolver.GetVirtualPath(currentPage.ContentLink);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        var actionUri = string.Format(&quot;{0}XFormPost/&quot;, pageUrl);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        actionUri = UriSupport.AddQueryString(actionUri, &quot;XFormId&quot;, currentBlock.Form.Id.ToString());
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        actionUri = UriSupport.AddQueryString(actionUri, &quot;failedAction&quot;, &quot;Failed&quot;);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        actionUri = UriSupport.AddQueryString(actionUri, &quot;successAction&quot;, &quot;Success&quot;);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        actionUri = UriSupport.AddQueryString(actionUri, &quot;contentId&quot;, currentBlockID.ToString());
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        currentBlock.ActionUri = actionUri;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    return PartialView(currentBlock);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;}
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/code&gt;&amp;lt;/pre&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;h3&gt;/Views/XFormBlock/Index.cshtml&lt;/h3&gt;

&lt;p&gt;This is just a simple view for the block. The primary thing that is different compared to how we normally output page properties is that we need to set the action on the form.&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;bogus-wrapper&quot;&gt;&lt;notextile&gt;&lt;figure class=&quot;code&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre class=&quot;line-numbers&quot;&gt;&lt;span class=&quot;line-number&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;2&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;4&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;6&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;7&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;8&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;9&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;10&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;11&lt;/span&gt;
&lt;span class=&quot;line-number&quot;&gt;12&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;code class=&quot;&quot;&gt;&lt;span class=&quot;line&quot;&gt;@model XFormBlock&amp;lt;/p&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;div @Html.EditAttributes(m =&gt; m.Form)&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    @Html.ValidationSummary()
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    @using (Html.BeginXForm(Model.Form, new { Action = Model.ActionUri }))
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    {
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;        Html.RenderXForm(Model.Form);
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;    }
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;/div&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;line&quot;&gt;&amp;lt;p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/figure&gt;&lt;/notextile&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;And that&#39;s it. With this solution, you don&#39;t need to worry handling the XForm in any specific page controllers that the block lives in, although you could easily just override the &lt;code&gt;XFormPost()&lt;/code&gt; method in the &lt;code&gt;BasePageController&lt;/code&gt; if needed. This also supports the built-in &#39;Save to database&#39; and/or &#39;Send e-mail&#39; submit options.&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Get the PageData of some Catalog Node</title>
        <link href="http://world.episerver.com/Blogs/K-Khan-/Dates/2013/4/Get-the-PageData-of-some-Catalog-Node/" />
        <id>http://world.episerver.com/Blogs/K-Khan-/Dates/2013/4/Get-the-PageData-of-some-Catalog-Node/</id>
        <updated>2013-04-11T08:46:15.0000000Z</updated>
        <summary type="html">&lt;p style=&quot;width: 150.79%; height: 40px;&quot;&gt;Below function can help you to retrieve PageData object of some CatalogNode without effecting performance.&lt;/p&gt;
&lt;p style=&quot;width: 175.66%; height: 620px;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private PageData FindPageByCatalogNode(CatalogNode catalogNode)     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string text = (catalogNode.ParentNode != null) ? catalogNode.ParentNode.ID : &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CatalogContext.Current.GetCatalogNode(catalogNode.ParentNodeId).ID;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (text == null)     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CatalogDto catalogDto = CatalogContext.Current.GetCatalogDto(catalogNode.CatalogId);     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text = ((catalogDto == null || catalogDto.Catalog == null || catalogDto.Catalog.Count == 0) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ? string.Empty : catalogDto.Catalog[0].Name);     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string key = MappedPPDB.BuildKey(new object[]     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catalogNode.CatalogNodeId,     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string.Empty,     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catalogNode.ParentNodeId,     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catalogNode.CatalogId,     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NodeType.CatalogNode,     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; catalogNode.ID,     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int id = MappedPPDB.Instance.LoadMapping(&quot;CatalogPageProvider&quot;, key).Id;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &lt;strong&gt;DataFactory.Instance.GetPage(new PageReference(id, &quot;CatalogPageProvider&quot;))&lt;/strong&gt;;     &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Integrating EPiServer 7 with MVC – Next Steps</title>
        <link href="http://bakingwebsites.co.uk/?p=418" />
        <id>http://bakingwebsites.co.uk/?p=418</id>
        <updated>2013-04-09T16:40:42.0000000Z</updated>
        <summary type="html">My previous blog post, Integrating EPiServer 7 with an existing MVC site, outlined the initial steps to get EPiServer 7 running. However there are a number of additional steps you may need to take before your site is fully integrated. Convert any Controllers not in Areas If your site only contains controllers within Areas then [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=bakingwebsites.co.uk&amp;#038;blog=11998060&amp;#038;post=418&amp;#038;subd=bakingwebsites&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</summary>
    </entry>    <entry>
        <title>Custom routing for EPiServer content</title>
        <link href="http://joelabrahamsson.com/custom-routing-for-episerver-content/" />
        <id>http://joelabrahamsson.com/custom-routing-for-episerver-content/</id>
        <updated>2013-04-09T04:30:00.0000000Z</updated>
        <summary type="html">Two real-world examples of how to customize the routing for EPiServer pages to take control of the site&#39;s URLs and links.
&lt;p&gt;EPiServer 7 CMS uses the built in routing functionality in ASP.NET for URL handling. The default routing when using EPiServer 7 mimics the friendly URL functionality in older versions of the CMS in which the URL for a page is built up of it&#39;s URLSegment property prefixed by it&#39;s ancestors URL segments.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/617/page-tree-routing.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;There are many nice aspects of the default behavior.&amp;nbsp; For instance, URL&#39;s for pages match their places in the page tree and in navigation elements making them seem logical and predictable. However, it also has the drawback of tying the URL for a page to it&#39;s location in the page tree making it risky to move content.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Also, in some&lt;/strong&gt; situations, such as when you have a site with a lot of content, it may not be appropriate to place content in a specific place in the content tree even though it belongs there.&lt;/p&gt;
&lt;p&gt;It may also be that a page is only used as a data bearer without a template and links to it should lead to some other page, optionally with some parameters in the URL.&lt;/p&gt;
&lt;p&gt;In such cases we need to extend or modify EPiServer&#39;s default routing. In this article I&#39;ll show two real-world examples of doing just that.&lt;/p&gt;
&lt;h2&gt;Custom routing using partial routing&lt;/h2&gt;
&lt;p&gt;The first example is drawn from how articles are routed on this site. The article you&#39;re currently reading is tied to the EPiServer CMS category (a page) on the site which is reflected in navigation elements.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/617/navigation-elements.png&quot; alt=&quot;&quot; width=&quot;718&quot; height=&quot;315&quot; /&gt;&lt;/p&gt;
&lt;p&gt;It does not however reside under the CMS category&#39;s page. Instead it&#39;s placed in a hierarchical structure based on the date it was created.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/617/place-in-page-tree.png&quot; alt=&quot;&quot; width=&quot;675&quot; height=&quot;341&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Why articles is stored this way is beyond the scope of this article but, as you can probably imagine, storing them this way brings a few problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Making the article&lt;/strong&gt; belong to the CMS category is straight forward. All that&#39;s needed is a property of type ContentReference or PageReference on the page type used for articles. That can then be used when building menus and breadcrumbs.&lt;/p&gt;
&lt;p&gt;Listing content based on categories is a bit trickier to achieve performance wise with the CMS&#39; API but in my case I have Find to help me with that.&lt;/p&gt;
&lt;p&gt;Finally, the URL for an article will be /&amp;lt;year&amp;gt;/&amp;lt;month&amp;gt;/&amp;lt;URLSegment&amp;gt;/. While that&#39;s not terrible it&#39;s not what I want. Instead I wanted the URL&#39;s for articles to be simply the host name followed by their URL segments.&lt;/p&gt;
&lt;h3&gt;Partial routing&lt;/h3&gt;
&lt;p&gt;EPiServer 7 features a concept called partial routing. In &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/7/Routing/Partial-Routing/Partial-Routing/&quot;&gt;the developer guide&lt;/a&gt; it&#39;s described as&lt;/p&gt;
&lt;blockquote&gt;Partial routing makes it possible to extend routing beyond pages. You can use partial routing either to route to data outside EPiServer CMS or to route to other content types than pages.&lt;/blockquote&gt;
&lt;p&gt;We can however also use it to route ordinary pages, like articles in this case.&lt;/p&gt;
&lt;p&gt;To utilize partial routing we create a class implementing IPartialRouter&amp;lt;TContent, TRoutedData&amp;gt; found in the EPiServer.Web.Routing namespace. The first type parameter specifies the type of content we&#39;re interested in routing children for. The second the type of content, or other type of object that we&#39;ll be routing.&lt;/p&gt;
&lt;p&gt;Did I lose you there? Perhaps a fruity example can clarify things.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A class that implements&lt;/strong&gt; IPartialRouter&amp;lt;Banana, Apple&amp;gt; will be able to route outgoing URLs whenever the object to route is an apple. Whenever a part of the URL for an incoming request has been routed to a content object of type Banana and there are still parts of the URL left to route it will be handed the banana and information about the remaining URL and asked to return an apple.&lt;/p&gt;
&lt;p&gt;Crystal clear, right? Perhaps not. Let&#39;s look at how we can use it to route articles.&lt;/p&gt;
&lt;h3&gt;Implementing IPartialRouter&lt;/h3&gt;
&lt;p&gt;Given that we want articles to have relative URLs that are simply their URL segments the first type parameter when implementing IPartialRouter is the page type class that is used for the start page. The second type parameter is the page type used for articles.&lt;/p&gt;
&lt;p&gt;Let&#39;s create a class that implements IPartialRouter with those type parameters and have Visual Studio generate the required methods for us.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;using System.Web.Routing;&lt;br /&gt;using EPiServer.Web.Routing;&lt;br /&gt;using EPiServer.Web.Routing.Segments;&lt;br /&gt;using MySite.Models.Pages;&lt;br /&gt;&lt;br /&gt;namespace MySite.Routing&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; public class ArticleRouter : IPartialRouter&amp;lt;StartPage, ArticlePage&amp;gt;&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public object RoutePartial(StartPage content, SegmentContext segmentContext)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new System.NotImplementedException();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public PartialRouteData GetPartialVirtualPath(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArticlePage content, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string language, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RouteValueDictionary routeValues,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RequestContext requestContext)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new System.NotImplementedException();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;As you can see, there are two methods that we&#39;ll need to implement. RoutePartial is for incoming requests while GetPartialVirtualPath is for outgoing.&lt;/p&gt;
&lt;p&gt;We&#39;ll start by implementing the RoutePartial method.&lt;/p&gt;
&lt;h3&gt;RoutePartial&lt;/h3&gt;
&lt;p&gt;The RoutePartial method will be invoked whenever a the first parts of the URL points to a page of the TContent type parameter and there are remaining parts of the URL left to route. In this example, as we&#39;re implementing the IPartialRouter interface with the start page&#39;s type as the TContent parameter that will pretty much always be the case.&lt;/p&gt;
&lt;p&gt;The method is invoked with two arguments. The first is the content of type TContent that the first parts of the URL route to, the start page in our case. The second is an object of type SegmentContext which contains information about the next segment in the URL to route.&lt;/p&gt;
&lt;p&gt;Using the two arguments it&#39;s our job to figure out what article, if any, the request should be routed to.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public object RoutePartial(StartPage content, SegmentContext segmentContext)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; if (!content.ContentLink.CompareToIgnoreWorkID(ContentReference.StartPage))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; var nextSegment = segmentContext.GetNextValue(segmentContext.RemainingPath);&lt;br /&gt;&amp;nbsp; var urlSegment = nextSegment.Next;&lt;br /&gt;&amp;nbsp; if (string.IsNullOrEmpty(urlSegment))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; ArticlePage article = null;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; //TODO: Figure out which article it is we&#39;re routing based on the urlSegment variable, if any, and populate the article variable with that.&lt;br /&gt;&lt;br /&gt;&amp;nbsp; if (article != null)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; segmentContext.RemainingPath = nextSegment.Remaining;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; segmentContext.RoutedContentLink = article.ContentLink;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; return article;&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;There&#39;s quite a few things going on in the above code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First of all it&lt;/strong&gt; verifies that the root content is indeed an object for which we want to route remaning parts of the URL. In other words, if we for some reason are dealing with a page of the StartPage type that is not the start page. Not likely when dealing with start pages perhaps, but stranger things have happened and this check may be vital in other scenarios.&lt;/p&gt;
&lt;p&gt;Next we proceed to retrieve the next part of the URL which we assign to the urlSegment variable. For an URL such as /hello-world/ the urlSegment variable&#39;s value will be &quot;hello-world&quot;. For an URL such as /hello/world/ the urlSegment variable&#39;s value will be &quot;hello&quot;.&lt;/p&gt;
&lt;p&gt;Given that there is indeed at least one more segment in the URL we proceed to locate an article whose URL segment matches that. As that&#39;s code specific to the site I&#39;ve omitted my implementation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How one would do&lt;/strong&gt; this can vary greatly from site to site. On a small site we may simply retrieve all articles and use LINQ&#39;s Where method to find an article with a matching URLSegment property. On a larger site we may use EPiServer Find or we may make the page&#39;s ID a part of the URL when implementing outgoing routing which we&#39;ll get to shortly.&lt;/p&gt;
&lt;p&gt;However we choose to locate articles, or whatever it it we&#39;re routing, we need to make sure to do it in a good way performance wise. This code will be called &lt;em&gt;a lot&lt;/em&gt;!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Given that we&#39;ve&lt;/strong&gt; found an article that we wish to route to we remove the URL segment that we&#39;ve taken care of from the SegmentContext by assigning the remaning part of the URL to its RemainingPath property. That is, given an article with a URL such as /hello-world/ where we have extracted &quot;hello-world&quot; from the segment context we update it to set its remaining path to nothing.&lt;/p&gt;
&lt;p&gt;Also, given that we&#39;ve found an article, we modify the segment context so that it knows that we&#39;ve found content that we want to route to.&lt;/p&gt;
&lt;p&gt;Finally we return the article, or null, if we didn&#39;t find one. If we return null nothing in particular will happen. The routing will proceed as usual routing to a page of some other type or resulting in a 404.&lt;/p&gt;
&lt;h3&gt;GetPartialVirtualPath&lt;/h3&gt;
&lt;p&gt;The GetPartialVirtualPath method will be invoked when an article is being outgoing routed. That is, when we for instance create a link to an article with the PageLink HTML helper method.&lt;/p&gt;
&lt;p&gt;It&#39;s invoked with four arguments which we can use to determine the context in which the article is being routed. Based on those we need to return an object of type PartialRouteData.&lt;/p&gt;
&lt;p&gt;The PartialRouteData class has two properties - BasePathRoot and PartialVirtualPath. The generated relative URL will be a combination of the relative URL of the content referenced by BasePathRoot and whatever we set PartialVirtualPath to.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public PartialRouteData GetPartialVirtualPath(&lt;br /&gt;&amp;nbsp; ArticlePage content, &lt;br /&gt;&amp;nbsp; string language, &lt;br /&gt;&amp;nbsp; RouteValueDictionary routeValues,&lt;br /&gt;&amp;nbsp; RequestContext requestContext)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; var contentLink = ContentRoute.GetValue(&quot;node&quot;, requestContext, routeValues) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as ContentReference;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; if (!content.ContentLink.CompareToIgnoreWorkID(contentLink))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; return new PartialRouteData&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BasePathRoot = ContentReference.StartPage,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PartialVirtualPath = content.URLSegment&lt;br /&gt;&amp;nbsp; };&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;In the implementation&lt;/strong&gt; above we begin by extracting a reference to the content that is being routed using the ContentRoute.GetValue method. Typically this will be a reference to the same article that is being passed to the method as the &quot;content&quot; parameter. However, I&#39;ve found at least one situation when that wasn&#39;t the case.&lt;/p&gt;
&lt;p&gt;If the method is invoked in context of routing something else than the article passed in as the &quot;content&quot; variable we&#39;re not interested in modifying the routing so we simply return null.&lt;/p&gt;
&lt;p&gt;If however we are dealing with an article that we want to modify the routing for we create a new PartialRouteData object, populate its properties and return it.&lt;/p&gt;
&lt;p&gt;Since in this example we want articles to simply have their own URL segments as URLs we set the BasePathRoot to a reference to the start page and the PartialVirtualPath to the article&#39;s URLSegment property.&lt;/p&gt;
&lt;h3&gt;Using the partial router&lt;/h3&gt;
&lt;p&gt;Our partial router class is done. In order for it to be used we need to add it to the site&#39;s route table during start-up though. That&#39;s easily done using an initialization module and the RegisterPartialRouter extension method that EPiServer provides (in the EPiServer.Web.Routing namespace).&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;using System.Web.Routing;&lt;br /&gt;using EPiServer.Framework;&lt;br /&gt;using EPiServer.Framework.Initialization;&lt;br /&gt;using EPiServer.Web.Routing;&lt;br /&gt;&lt;br /&gt;namespace MySite.Routing&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]&lt;br /&gt;&amp;nbsp; public class RouteInitialization : IInitializableModule&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Initialize(InitializationEngine context)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var articleRouter = new ArticleRouter();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RouteTable.Routes.RegisterPartialRouter(articleRouter);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Uninitialize(InitializationEngine context)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Preload(string[] parameters)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/pre&gt;
&lt;h3&gt;Restoring tree-like URLs&lt;/h3&gt;
&lt;p&gt;In the above example we modify EPiServer&#39;s default routing to make pages of a specific type, articles, have URLs that are simply their URL segments. That&#39;s what I wanted for this site as it decouples article&#39;s URLs from both their place in the tree and their categories.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/617/startpage_as_url_root.png&quot; alt=&quot;&quot; width=&quot;718&quot; height=&quot;319&quot; /&gt;&lt;/p&gt;
&lt;p&gt;However, we&#39;re not limited to that specific use case. For instance we may instead want articles in the example scenario we&#39;ve looked at here to have a URL based on their categories instead. As if they were actually placed under their categories in the page tree.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/617/category_as_url_root.png&quot; alt=&quot;&quot; width=&quot;718&quot; height=&quot;319&quot; /&gt;&lt;/p&gt;
&lt;p&gt;To accomplish that we would need to make a few modifications to our partial router class.&lt;/p&gt;
&lt;p&gt;Since the &quot;URL homes&quot;, the base path, for articles won&#39;t be the start page but instead a categories the first step is to modify the TContent type parameter when implementing IPartialRouter. Instead of the start page&#39;s type we set it to the type under which articles will reside URL-wise. In the case of this site that would be the class CategoryPage.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public class ArticleRouter : IPartialRouter&amp;lt;&lt;strong&gt;CategoryPage&lt;/strong&gt;, ArticlePage&amp;gt;&lt;/pre&gt;
&lt;p&gt;Changing the type parameter of the implemented interface we need to change the type of the RoutePartial method&#39;s first parameter or the compiler will complain.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public object RoutePartial(CategoryPage content, SegmentContext segmentContext)&lt;/pre&gt;
&lt;p&gt;Now the compiler is happy but we&#39;ll need to make some changes to the code as well. Let&#39;s start with the GetPartialVirtualPath method as that&#39;s easiest.&lt;/p&gt;
&lt;p&gt;All we need to do there is change what we set the BasePathRoot property on the object we return to. Instead of setting it to a reference to the start page we set it to a reference to some other page that will provide the first part of the article&#39;s URL. For our example scenario that would be the property that points to the article&#39;s main category.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;return new PartialRouteData&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; BasePathRoot = &lt;strong&gt;content.MainCategory&lt;/strong&gt;,&lt;br /&gt;&amp;nbsp; PartialVirtualPath = content.URLSegment&lt;br /&gt;};&lt;/pre&gt;
&lt;p&gt;The RoutePartial method will need to undergo larger changes.&lt;/p&gt;
&lt;p&gt;We can skip the initial check that the root content which is passed in in as the &quot;content&quot; variable is indeed the root page we care about as we now have multiple possible roots.&lt;/p&gt;
&lt;p&gt;Instead we&#39;ll need to verify that the root, the category, should be used as the routing parent for the article that we&#39;re routing.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;ArticlePage article = null;&lt;br /&gt;&lt;br /&gt;//TODO: Figure out which article it is we&#39;re routing based on the urlSegment variable, if any, and populate the article variable with that.&lt;br /&gt;&lt;br /&gt;if (article == null &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; || &lt;strong&gt;content.ContentLink.CompareToIgnoreWorkID(article.MainCategory)&lt;/strong&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;segmentContext.RemainingPath = nextSegment.Remaining;&lt;br /&gt;segmentContext.RoutedContentLink = article.ContentLink;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;return article;&lt;/pre&gt;
&lt;h2&gt;Custom routing using a custom segment&lt;/h2&gt;
&lt;p&gt;We&#39;ve now seen an example of how we can use the partial routing concept in EPiServer 7 to implement custom routing. In the next example we&#39;ll look at another way of customizing routing - by using a custom implementation of the ISegment interface.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;On this site I use&lt;/strong&gt; pages to define tags. That is, each tag is a page somewhere in the page tree and articles have a content area to which I can add one or more tag pages. This allows me to change the name of a tag without having to update all pages tagged with it. It also gives me the possibility to add unique content to a tag beyond its name.&lt;/p&gt;
&lt;p&gt;When I tag a page with one or more existing tags I simply drag them to the content area. When I render a list of tags I simply output a link to each tag using the PageLink HTML helper.&lt;/p&gt;
&lt;p&gt;As I have a separate template for tag pages this works great. However, when the site first went live I didn&#39;t have that template. Instead I wanted a tag-link to point to a search for the tag using the site&#39;s search page.&lt;/p&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/617/tag_search_url.png&quot; alt=&quot;&quot; width=&quot;718&quot; height=&quot;367&quot; /&gt;&lt;/p&gt;
&lt;p&gt;One way to solve that would of course have been to find all places where links to tags were rendered and modify the code there to link to the search page. That wouldn&#39;t have been a very flexible solution though. By instead modifying the outgoing URLs for tag pages by modifying routing for them I didn&#39;t have to touch any other code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;At first glance it&lt;/strong&gt; may seem like we could use partial routing for this scenario as well but a case like this, where we want to route to a specific page with one or more query string parameters isn&#39;t really what partial routing is for.&lt;/p&gt;
&lt;p&gt;Instead we can handle cases like this by creating a custom implementation of the ISegment interface and register a&amp;nbsp; route that uses the segment.&lt;/p&gt;
&lt;h3&gt;Creating a segment&lt;/h3&gt;
&lt;p&gt;In order to create a custom segment we create a class that implements ISegment (in the EPiServer.Web.Routing.Segments namespace). Alternatively we can let our class inherit SegmentBase which I&#39;ll do in this example.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;using System;&lt;br /&gt;using System.Web.Routing;&lt;br /&gt;using EPiServer.Web.Routing.Segments;&lt;br /&gt;&lt;br /&gt;namespace MySite.Routing&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; public class TagSearchSegment : SegmentBase&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public TagSearchSegment(string name) : base(name)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override bool RouteDataMatch(SegmentContext context)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new NotImplementedException();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public override string GetVirtualPathSegment(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RequestContext requestContext, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RouteValueDictionary values)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new NotImplementedException();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;As you can see from the code above, where I&#39;ve had Visual Studio autogenerate required methods for me, SegmentBase has two abstract methods that we must implement - RouteDataMatch and GetVirtualPathSegment.&lt;/p&gt;
&lt;p&gt;RouteDataMatch is invoked during in-bound routing. We get passed information about the current context and can use that to determine if we want to modify the routing. If we do we modify the context in some way and return true. However, as we only care about out-bound routing in this example we can simply implement it to return false.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public override bool RouteDataMatch(SegmentContext context)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; return false;&lt;br /&gt;}&lt;/pre&gt;
&lt;h3&gt;GetVirtualPathSegment&lt;/h3&gt;
&lt;p&gt;The GetVirtualPathSegment method is invoked during outgoing routing and in order to modify the URL we&#39;ll need to return a string with the URL, or part of the URL, that we want to route to. We&#39;ll also need to remove values that we feel we&#39;ve taken care of from the RouteValueDictionary that is passed to the method.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public override string GetVirtualPathSegment(&lt;br /&gt;&amp;nbsp; RequestContext requestContext, &lt;br /&gt;&amp;nbsp; RouteValueDictionary values)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; if (GetContextMode(requestContext.HttpContext, requestContext.RouteData) &lt;br /&gt;      != ContextMode.Default)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; var contentLink = ContentRoute.GetValue(&quot;node&quot;, requestContext, values) &lt;br /&gt;                      as ContentReference;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; if (ContentReference.IsNullOrEmpty(contentLink))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; var contentLoader = ServiceLocator.Current.GetInstance&amp;lt;IContentLoader&amp;gt;();&lt;br /&gt;&amp;nbsp; var tagToRoute = contentLoader.Get&amp;lt;IContent&amp;gt;(contentLink) as TagPage;&lt;br /&gt;&amp;nbsp; if (tagToRoute == null)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; string tagSearchUrl = null;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; //TODO: Figure out the url we want to route to, if any, and set the tagSearchUrl variable to that&lt;br /&gt;&lt;br /&gt;&amp;nbsp; if (tagSearchUrl == null)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; values.Remove(&quot;node&quot;);&lt;br /&gt;&amp;nbsp; values.Remove(&quot;controller&quot;);&lt;br /&gt;&amp;nbsp; values.Remove(&quot;action&quot;);&lt;br /&gt;&amp;nbsp; values.Remove(&quot;routedData&quot;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; return tagSearchUrl;&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;That&#39;s quite a mouthful! Let&#39;s go through it step by step.&lt;/p&gt;
&lt;p&gt;First we check that we&#39;re not in edit mode using a helper method. This is necessary as we will otherwise get a 404,&amp;nbsp; or worse, when viewing tag pages in edit mode as our code will route to the search page while EPiServer will add the tag&#39;s ID to the URL, meaning that we&#39;ll end up viewing invoking the search page&#39;s template with the tag page as the current page.&lt;/p&gt;
&lt;p&gt;The GetContextMode method looks like this:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;private static ContextMode GetContextMode(&lt;br /&gt;&amp;nbsp; HttpContextBase httpContext, &lt;br /&gt;&amp;nbsp; RouteData routeData)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; var contextModeKey = &quot;contextmode&quot;;&lt;br /&gt;&amp;nbsp; if (routeData.DataTokens.ContainsKey(contextModeKey))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (ContextMode)routeData.DataTokens[contextModeKey];&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; if ((httpContext == null) || (httpContext.Request == null))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ContextMode.Default;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; if (!PageEditing.GetPageIsInEditMode(httpContext))&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return ContextMode.Default;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; return ContextMode.Edit;&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Next we proceed to extract a reference to the content that is being  routed. If we can&#39;t find such a reference we&#39;re probably routing a file  or something else that we don&#39;t care about so we return null.&lt;/p&gt;
&lt;p&gt;Given that we have a content reference we proceed to fetch the content that we&#39;re routing. If it isn&#39;t a tag we don&#39;t care about it so we return null.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If however the&lt;/strong&gt; content that we&#39;re routing is a tag we build up the URL we want to route to. I&#39;ve omitted that code as it may be specific to each site and use case.&lt;/p&gt;
&lt;p&gt;Given that we have a URL that we want to route to we return it, but before doing so we remove route values that we don&#39;t want anyone else who cares about routing to see as we&#39;ve already taken care of them.&lt;/p&gt;
&lt;h3&gt;Using the segment&lt;/h3&gt;
&lt;p&gt;With the custom segment done we need to register a route that uses it for it to matter. As this should be done during start-up of the site we add an initialization module.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;using System.Collections.Generic;&lt;br /&gt;using System.Web.Routing;&lt;br /&gt;using EPiServer.Framework;&lt;br /&gt;using EPiServer.Framework.Initialization;&lt;br /&gt;using EPiServer.Web.Routing;&lt;br /&gt;using EPiServer.Web.Routing.Segments;&lt;br /&gt;&lt;br /&gt;namespace MySite.Routing&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]&lt;br /&gt;&amp;nbsp; public class RouteInitialization : IInitializableModule&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Initialize(InitializationEngine context)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var segment = new TagSegment(&quot;tag&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var routingParameters = new MapContentRouteParameters()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SegmentMappings = new Dictionary&amp;lt;string, ISegment&amp;gt;()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; routingParameters.SegmentMappings.Add(&quot;tag&quot;, segment);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RouteTable.Routes.MapContentRoute(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: &quot;tags&quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: &quot;{language}/{tag}&quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; defaults: new { action = &quot;index&quot; },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parameters: routingParameters);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Uninitialize(InitializationEngine context)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Preload(string[] parameters)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;Using the code in the Initialize method above we register a route for &quot;{language}/{tag}&quot;. We map the {tag} part to our custom segment meaning that it will be replaced with whatever we return from the segment&#39;s GetVirtualPathSegment method.&lt;/p&gt;
&lt;h2&gt;Basic routing&lt;/h2&gt;
&lt;p&gt;We&#39;ve just seen two fairly advanced examples of how the routing for content can be customized when using EPiServer 7. In both cases we&#39;re more or less in complete control and can execute custom logic on a per-request basis.&lt;/p&gt;
&lt;p&gt;That&#39;s nice, but there may be cases where we want to do something simpler. Were we don&#39;t need all that power and flexibility. For instance, let&#39;s say we for some reason wanted to support outputting only the first n characters of the name of a page given that the request is for a page followed by /name/&amp;lt;n&amp;gt;/.&lt;/p&gt;
&lt;p&gt;Not the most realistic scenario perhaps, but it does make for a simple example. Anyhow, To handle such a case we wouldn&#39;t have to create a partial router or a custom segment. All we need to do is register a route using the MapContentRoute method during start-up.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;RouteTable.Routes.MapContentRoute(&lt;br /&gt;&amp;nbsp; &quot;myRoute&quot;, &quot;{language}/{node}/{action}/{charcount}&quot;, &lt;br /&gt;&amp;nbsp; new {action = &quot;name&quot;});&lt;/pre&gt;
&lt;p&gt;Now, given that we&#39;re using MVC, we can add an action to controllers for pages named Name which will be used for matching requests.&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;public ActionResult Name(CategoryPage currentPage, int charCount)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; if (currentPage.PageName.Length &amp;lt; charCount)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; charCount = currentPage.PageName.Length;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; return new ContentResult()&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Content = currentPage.PageName.Substring(0, charCount)&lt;br /&gt;&amp;nbsp; };&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;img class=&quot;thumbnail-centered&quot; src=&quot;/PageFiles/617/name_routing.png&quot; alt=&quot;&quot; width=&quot;511&quot; height=&quot;207&quot; /&gt;&lt;/p&gt;
&lt;p&gt;For another example of this type of custom routing check the &lt;a href=&quot;http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-CMS/7/Routing/Routing/&quot;&gt;routing section&lt;/a&gt; in EPiServer&#39;s developers guide.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;We&#39;ve seen a couple of examples of how we can take charge of the routing for specific types of content. With this in our toolbox we can free the URLs for pages from the content tree, change where pages links to as well as other interesting stuff.&lt;/p&gt;
&lt;p&gt;A couple of words of warning is in place though.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First of all, when&lt;/strong&gt; modifying both the outbound and inbound routing as in the first example, the one with articles, we&#39;re bypassing EPiServer&#39;s functionality for ensuring that no two pages can have the same URL. That is, in the example with the articles we&#39;ll need to ensure that no two articles have the same URL segment.&lt;/p&gt;
&lt;p&gt;Second, do think about that the methods for routing, such as the ones we&#39;ve looked at in this article may be invoked a lot, so be sure to test the performance with realistic data before deploying to production.&lt;/p&gt;
&lt;p&gt;With that said, I must say that it&#39;s nice that we can control the routing in just about any way we&#39;d like. That brings many interesting possibilities.&lt;/p&gt;
&lt;p&gt;Happy routing!&lt;/p&gt;
</summary>
    </entry>    <entry>
        <title>Deploying an EPiServer website in a load balanced environment using master slave licenses without downtime for visitors</title>
        <link href="http://blog.mathiaskunto.com/?p=2337" />
        <id>http://blog.mathiaskunto.com/?p=2337</id>
        <updated>2013-04-08T20:31:45.0000000Z</updated>
        <summary type="html">When working with large EPiServer websites having hundreds of tousands of visitors each month, you will want to make sure that you get as little downtime as possible while deploying your new releases; especially if the website&amp;#8217;s content is of &amp;#8230; &lt;a href=&quot;http://blog.mathiaskunto.com/2013/04/08/deploying-an-episerver-website-in-a-load-balanced-environment-using-master-slave-licenses-without-downtime-for-visitors/&quot;&gt;Continue reading &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;</summary>
    </entry>    <entry>
        <title>Resolve PageType &amp; ContentType from Class</title>
        <link href="http://talk.alfnilsson.se/?p=154" />
        <id>http://talk.alfnilsson.se/?p=154</id>
        <updated>2013-04-07T23:05:30.0000000Z</updated>
        <summary type="html">In PageTypeBuilder for EPiServer CMS 6 we had a lovely feature called&#160;PageTypeResolver which could be used to find the Id of a PageType based on your implementation of TypedPageData. All you needed to do is run&#160;PageTypeResolver.Instance.GetPageTypeID(typeof(MyPageType)) and you would get a Nullable Int which represents the Id of your PageType, or null if no PageType [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=talk.alfnilsson.se&amp;#038;blog=18285343&amp;#038;post=154&amp;#038;subd=toders&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</summary>
    </entry>    <entry>
        <title>EPiServer architecture and cross cutting concerns</title>
        <link href="http://world.episerver.com/Blogs/Daniel-Ovaska/Dates/2013/4/EPiServer-architecture-and-cross-cutting-concerns/" />
        <id>http://world.episerver.com/Blogs/Daniel-Ovaska/Dates/2013/4/EPiServer-architecture-and-cross-cutting-concerns/</id>
        <updated>2013-04-05T14:57:58.0000000Z</updated>
        <summary type="html">&lt;h2&gt;Introduction&lt;/h2&gt;  &lt;p&gt;Let&#39;s spend a few moments to talk about a few different ways how to implement &lt;a href=&quot;http://en.wikipedia.org/wiki/Cross-cutting_concern&quot;&gt;cross cutting concerns&lt;/a&gt; type of functionality like logging, caching, auditing etc while keeping a high code quality. Each has it&#39;s own pros and cons which makes different solutions good for different project sizes. I&#39;ll use logging as an example of a cross cutting funtionality to be added and a repository for news as an example of the &amp;quot;real&amp;quot; functionality to extend.&lt;/p&gt;  &lt;h2&gt;Architecture lvl 0: Basic cross cutting concerns code mixed with actual function&lt;/h2&gt;  &lt;p&gt;&lt;em&gt;Also known as…no architecture…&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Let&#39;s start with the simplest version; code for performance logging is mixed with code for the actual functionality you want to log. Dirty but fast to implement for a single class. This will give us something to discuss pros and cons for. &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;a href=&quot;/Globals/xmlrpc/31704/2013/04/05/NewsRepositoryUML_2.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;NewsRepositoryUML&quot; border=&quot;0&quot; alt=&quot;NewsRepositoryUML&quot; src=&quot;/Globals/xmlrpc/31704/2013/04/05/NewsRepositoryUML_thumb.jpg&quot; width=&quot;439&quot; height=&quot;144&quot; /&gt;&lt;/a&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;An example class called NewsRepository with only one function, GetAllNews() was created. This function returns a list of NewsItems and will serve as the example service/repository class. Support was then added for &lt;a href=&quot;http://logging.apache.org/log4net/&quot;&gt;log4net,&lt;/a&gt; which is a nice logging framework which is installed by default with EPiServer. Below is the simple example class with some basic logging. It uses a PerformanceTimer class to get a really accurate time of execution (custom made class so it&#39;s not part of any framework if you are wondering). Feel free to use the .NET DateTime.Now instead if you don&#39;t need extreme precision. Thread.Sleep is used to simulate that this method takes a while to run. The advantage with this simple version of architecture, or lack of it, for handling cross cutting concerns is that it&#39;s easy to find all code that is being run, and as long as the amount of code is pretty small, it will be a good solution. The value of simplicity is a value in itself.&lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; NewsRepository:INewsRepository
    {
        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;readonly&lt;/span&gt; ILog _logger;
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; NewsRepository()
        {
            _logger = LogManager.GetLogger(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(NewsRepository));
        }
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; List&amp;lt;NewsItem&amp;gt; GetAllNews()
        {
            var timer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; PerformanceTimer();
            timer.Start();
            Thread.Sleep(200);
            var duration = timer.Stop();
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (_logger.IsDebugEnabled)
            {
                _logger.Debug(&lt;span class=&quot;str&quot;&gt;&amp;quot;Result of GetAllNews() in &amp;quot;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&amp;quot;{0:f4}&amp;quot;&lt;/span&gt;, duration) + &lt;span class=&quot;str&quot;&gt;&amp;quot; seconds&amp;quot;&lt;/span&gt;);
            }
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; List&amp;lt;NewsItem&amp;gt;(){&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; NewsItem(){Headline = &lt;span class=&quot;str&quot;&gt;&amp;quot;Item 1&amp;quot;&lt;/span&gt;},&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; NewsItem(){Headline = &lt;span class=&quot;str&quot;&gt;&amp;quot;Item 2&amp;quot;&lt;/span&gt;}};
          
        }
    }&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;div class=&quot;csharpcode&quot;&gt;&amp;#160;&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;h2&gt;Architecture lvl 1: Implementing logging as a decorator to the original class&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/31704/2013/04/05/SOLID_2.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;SOLID&quot; border=&quot;0&quot; alt=&quot;SOLID&quot; src=&quot;/Globals/xmlrpc/31704/2013/04/05/SOLID_thumb.jpg&quot; width=&quot;311&quot; height=&quot;250&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  &lt;p&gt;Ok, so that covered the basic case of logging. Not much to see yet. What can possibly go wrong with this beautiful code? Well, the main issue is that this function will contain both code for GetAllNews() and the code needed to provide logging within the same method. This is what you in computer science would refer to as low cohesion. The class does a bit of everything. Right now that is no big problem but what if some caching, security and auditing was thrown in as well while the customer comes up with 10 new improvements to the original functionality. Pretty soon this will become a method that is 500+ lines of code where only a small part actually is about the main functionality. Developers will then start to groan about code quality. Customers will start to groan about high maintainance bills. People are not happy and projects starts to fall apart. Not a happy place to be in…&amp;#160; &lt;br /&gt;Let&#39;s back the tape and say this above was the first simplest implementation but now the customer also wants these cross cutting concerns above implemented plus some extra improvements to GetAllNews(). According to the nice, “you may fool me once” philosophy, it&#39;s now time to refactor to a bigger costume according to the single responsibility principle (S) where we split this mixed functionality into separate classes.&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;
  &lt;p&gt;What if we extend the NewsRepository with a decorator pattern instead? This means that we create another class that implements the same interface but routes all calls to the original class (which only contains GetAllNews() functionality and no logging). This new decorator class can then add functionality to the original class without modifying the original class by placing itself &amp;quot;above&amp;quot; it. This is a much more &lt;a href=&quot;http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29&quot;&gt;SOLID&lt;/a&gt; approach…&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;
  &lt;p&gt;&amp;#160; &lt;br /&gt;&lt;a href=&quot;/Globals/xmlrpc/31704/2013/04/05/NewsRepositoryDecoratorUML_2.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;NewsRepositoryDecoratorUML&quot; border=&quot;0&quot; alt=&quot;NewsRepositoryDecoratorUML&quot; src=&quot;/Globals/xmlrpc/31704/2013/04/05/NewsRepositoryDecoratorUML_thumb.jpg&quot; width=&quot;538&quot; height=&quot;238&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;
  &lt;p&gt;Example of the new decorator class responsible for logging:&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;
  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; LoggingNewsDecorator:INewsRepository
{
        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;readonly&lt;/span&gt; INewsRepository _newsRepository;
        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;readonly&lt;/span&gt; ILog _logger;
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; LoggingNewsDecorator(INewsRepository newsRepository)
        {
            _newsRepository = newsRepository;
            _logger = LogManager.GetLogger(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(LoggingNewsDecorator));
        }
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; List&amp;lt;NewsItem&amp;gt; GetAllNews()
        {
            var timer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; PerformanceTimer();
            timer.Start();
            var result = _newsRepository.GetAllNews();
            var duration = timer.Stop();
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (_logger.IsDebugEnabled)
            {
                _logger.Debug(&lt;span class=&quot;str&quot;&gt;&amp;quot;Result of GetAllNews() in &amp;quot;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&amp;quot;{0:f4}&amp;quot;&lt;/span&gt;, duration) + &lt;span class=&quot;str&quot;&gt;&amp;quot; seconds&amp;quot;&lt;/span&gt;);
            }
            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; result;
        }
}&lt;/pre&gt;
&lt;/h2&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;
  &lt;p&gt;As you can see, this class above implements the same interface but takes the original class as a parameter in the constructor to be able to route all method calls. The code for the logging can now be in this class (LoggingNewsDecorator) and the code for the actual functionality can be in the original class (NewsRepository). This is what computer science would refer to as high cohesion which is a good thing. That will definitely help keeping a nice separation and structure when the code is growing. It is also possible to hook up this logging decorator automatically with an &lt;a href=&quot;http://en.wikipedia.org/wiki/Inversion_of_control&quot;&gt;IoC&lt;/a&gt; container like structuremap like this: &lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;
  &lt;pre class=&quot;csharpcode&quot;&gt;container.For&amp;lt;INewsRepository&amp;gt;()
         .Singleton()
         .Use&amp;lt;LoggingNewsDecorator&amp;gt;()
         .Ctor&amp;lt;INewsRepository&amp;gt;().Is&amp;lt;NewsRepository&amp;gt;();&lt;/pre&gt;
&lt;/h2&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;h2&gt;
  &lt;p&gt;This basically says that for the interface INewsRepository, use a singleton class of type LoggingNewsDecorator EXCEPT in the constructor when you try to make an instance of LoggingNewsDecorator; use the original NewsRepository there as parameter to the constructor instead. Otherwise you&#39;ll get a very funny circular reference thingy &lt;img title=&quot;(smile)&quot; border=&quot;0&quot; alt=&quot;(smile)&quot; src=&quot;https://wiki.mogul.se/s/en_GB/3393/fbf97d65fc2202c1ad8db08fef99ff488e0d596b.188/_/images/icons/emoticons/smile.png&quot; /&gt; If you don&#39;t like IoC, feel free to create your classes manually. The decorator pattern doesn&#39;t need IoC but it sure is helpful to avoid typing as much.&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;
  &lt;p&gt;Nice! Now with the decorator pattern in place you can actually chain classes for caching, auditing, logging etc on top of the actual functionality if you want.&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;
  &lt;p&gt;&lt;em&gt;TIP: If you are a fan of decorator pattern and interfaces, use a custom class to pass in parameters to methods and also return the response as a custom response class. This will minimize the number of times you need to update the interface when you add new filtering options etc. Visual Studio also has plenty of shortcuts to update classes and interfaces that helps keeping the additional work down to a minimum. 
      &lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;
  &lt;p&gt;This is normally where you stop, even if you have a big project. Creating the decorators will involve a lot of copy / paste if you have many classes you want to apply them on. It&#39;s SOLID but not very &lt;a href=&quot;http://en.wikipedia.org/wiki/Don%27t_repeat_yourself&quot;&gt;DRY&lt;/a&gt;. Implementing cross cutting concerns with the decorator pattern when you have a large project is a nice way of solving the problem and keeping a nice structure. But let&#39;s try another step just for fun and do some magic.&lt;/p&gt;
&lt;/h2&gt;
&lt;h2&gt;Architecture lvl 2: Implementing cross cutting concerns with AOP (Aspect Oriented Programming)&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;O day and night, but this is wondrous strange!” – Horatio&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Decorators involve a lot of copy / paste code to act as a wrapper around the original class. Is it possible to autogenerate these decorators so you only need to create them once for each type of decorator?&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/31704/2013/04/05/AOPinterceptor_4.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;AOPinterceptor&quot; border=&quot;0&quot; alt=&quot;AOPinterceptor&quot; src=&quot;/Globals/xmlrpc/31704/2013/04/05/AOPinterceptor_thumb_1.jpg&quot; width=&quot;554&quot; height=&quot;288&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;
&lt;p&gt;As it turns out, you can, since this is exactly what Castles dynamic proxy component does. It lets you autogenerate a class to a specific interface. Let&#39;s see some magic in action if you combine castles dynamic proxy with structuremap! Download the nuget package for castle.core and start with register a structuremap interceptor like this: &lt;/p&gt;
&lt;pre style=&quot;width: 100%; height: 25px&quot; class=&quot;csharpcode&quot;&gt;container.RegisterInterceptor(&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; StructureMapInterceptor());&lt;/pre&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; StructureMapInterceptor : TypeInterceptor
        {
            &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;readonly&lt;/span&gt; ProxyGenerator _proxy = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ProxyGenerator();
            &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; Process(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; target, IContext context)
            {
                var targetInterfaces = target.GetType().GetInterfaces();
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _proxy.CreateInterfaceProxyWithTargetInterface(
                    targetInterfaces.First(), &lt;span class=&quot;rem&quot;&gt;//What interface should we create proxy for&lt;/span&gt;
                    targetInterfaces,         &lt;span class=&quot;rem&quot;&gt;//Any addition interfaces we need to support?&lt;/span&gt;
                    target,                   &lt;span class=&quot;rem&quot;&gt;//Target class&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; LoggingInterceptor());&lt;span class=&quot;rem&quot;&gt;//What interceptors to generate &lt;/span&gt;
                                              &lt;span class=&quot;rem&quot;&gt;//and use in front of this target &lt;/span&gt;
                 
            }
            &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; MatchesType(Type type)
            {
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (type.IsSealed)
                    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (type.Name.Contains(&lt;span class=&quot;str&quot;&gt;&amp;quot;NewsRepository&amp;quot;&lt;/span&gt;))
                {
                    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
                }
               
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
            }
        }&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;br /&gt;
&lt;p&gt;This StructureMapInterceptor will basically tell what decorators to generate and use for which classes, this is refered to as the pointcut in AOP. It’s nothing more than a mapping of classes vs decorators. This pointcut is done by first specifying in the MatchesType() method if any custom decorators should be generated for the calling type. Returning true will trigger the Process() method which will return what decorators to use and in which order and trigger the ProxyGenerator from Castle to generate them. If you have a security decorator / interceptor you&#39;d probably want to run that first for instance. In this version we only generate a decorator for logging and this is implemented by the LoggingInterceptor class.&amp;#160; &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Below, in the bonus material section, it is also shown how to match classes by attributes instead if you want to do that. This method, MatchesType(), is where you add logic for it anyway.&lt;/p&gt;
&lt;p&gt;So, how do you create the logging interceptor class that implements the actual logging? So far we have only handled the mapping of what decorators to use for which classes...Let&#39;s check out the implementation of the actual interceptor for logging below:&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; LoggingInterceptor : IInterceptor
    {
        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Intercept(IInvocation invocation)
        {
            var logger = LogManager.GetLogger(invocation.TargetType);
            &lt;span class=&quot;kwrd&quot;&gt;try&lt;/span&gt;
            { 
                StringBuilder sb = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (logger.IsDebugEnabled)
                {
                    sb = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; StringBuilder(invocation.TargetType.FullName)
                        .Append(&lt;span class=&quot;str&quot;&gt;&amp;quot;.&amp;quot;&lt;/span&gt;)
                        .Append(invocation.Method)
                        .Append(&lt;span class=&quot;str&quot;&gt;&amp;quot;(&amp;quot;&lt;/span&gt;);
                    &lt;span class=&quot;kwrd&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; invocation.Arguments.Length; i++)
                    {
                        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (i &amp;gt; 0)
                            sb.Append(&lt;span class=&quot;str&quot;&gt;&amp;quot;, &amp;quot;&lt;/span&gt;);
                        sb.Append(invocation.Arguments[i]);
                    }
                    sb.Append(&lt;span class=&quot;str&quot;&gt;&amp;quot;)&amp;quot;&lt;/span&gt;);
                    logger.Debug(sb);
                }
                var timer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; PerformanceTimer();
                timer.Start();
                invocation.Proceed();
                var duration = timer.Stop();
                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (logger.IsDebugEnabled)
                {
                    logger.Debug(&lt;span class=&quot;str&quot;&gt;&amp;quot;Result of &amp;quot;&lt;/span&gt; + sb + &lt;span class=&quot;str&quot;&gt;&amp;quot; is: &amp;quot;&lt;/span&gt; + invocation.ReturnValue + 
                        &lt;span class=&quot;str&quot;&gt;&amp;quot; in &amp;quot;&lt;/span&gt; + &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&amp;quot;{0:f4}&amp;quot;&lt;/span&gt;, duration) + &lt;span class=&quot;str&quot;&gt;&amp;quot; seconds&amp;quot;&lt;/span&gt;);
                }
            }
            &lt;span class=&quot;kwrd&quot;&gt;catch&lt;/span&gt; (Exception e)
            {
                logger.Error(e);
                &lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt;;
            }
        }
    }&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;br /&gt;
&lt;p style=&quot;width: 100%; height: 291px&quot;&gt;This class will now work as our general logging decorator which can be put in front of any class that implements an interface! How cool is that? This class needs to implement an interface of type IInterceptor which only has a single method: Intercept. Information about the calling method etc is passed into the interceptor with the input parameter (IInvocation). To pass the method call along to the original class you can use invocation.Proceed(). This will call the actual GetNewsMethod() and return our little list of NewsItems. 
  &lt;br /&gt;Congratulations! With this single class, you can now enable logging and measure execution time on all classes you want in your solution without touching the actual functionality with a lot of copy / paste code. It&#39;s a bit of magic alright so I would personally only use this for logging and auditing. Implementing caching this way would probably leave me sleepless at night or at least with nightmares. This AOP way will probably only be worth the effort for really big projects where you have a lot of service layer classes etc. You will have to weigh the amount of duplicated code vs the increased complexity when choosing to go down this path.&lt;/p&gt;
&lt;h5&gt;&amp;#160;&lt;/h5&gt;
&lt;h3&gt;Performance considerations with autogenerating classes with AOP&lt;/h3&gt;
&lt;p style=&quot;width: 100%; height: 111px&quot;&gt;Since autogenerating the decorators is actually only done once and then stored, the performance hit will be small. The same as for a decorator class basically but with a few extra reflection calls within the interceptor. Not a huge drawback in my eyes. The question mark above a junior developers head will be the biggest drawback according to me. Documentation can help somewhat there.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;So now you have 3 options above how to implement cross cutting concerns. My general suggestion is to stick to the first option with inline code for small trivial solutions, switch to the second option with using decorators when you notice that the small project will probably grow into a big one and use the third magic one with aspect oriented programming only if you feel lucky and in special cases like logging. If you don&#39;t document the AOP variant well, it will probably take around a year for a junior programmer to figure out how it works though so keep that in mind as a likely side effect of the &amp;quot;magic&amp;quot; version...&lt;/p&gt;
&lt;p&gt;So, within 1 hour you can now implement performance logging on every class you want in a big project without actually touching an existing class and risk breaking it. How cool is that? Feel free to make your own interceptors for auditing and caching as an exercise &lt;img title=&quot;(smile)&quot; border=&quot;0&quot; alt=&quot;(smile)&quot; src=&quot;https://wiki.mogul.se/s/en_GB/3393/fbf97d65fc2202c1ad8db08fef99ff488e0d596b.188/_/images/icons/emoticons/smile.png&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Happy coding fellas!&lt;/p&gt;
&lt;h3&gt;Bonus material 1; Adding support for attributes to enable logging on a class&lt;/h3&gt;
&lt;p&gt;1. Create custom attribute / annotation to be able to mark a class you want to log &lt;/p&gt;
&lt;h3&gt;
  &lt;pre class=&quot;csharpcode&quot;&gt;[System.AttributeUsage(System.AttributeTargets.Class)]  
&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; LogAttribute : System.Attribute
{
}&lt;/pre&gt;
  &lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/h3&gt;
&lt;p&gt;2. Set attribute on class to enable log&lt;/p&gt;
&lt;h3&gt;
  &lt;pre class=&quot;csharpcode&quot;&gt;[Log]
&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; NewsRepository:INewsRepository
{
}&lt;/pre&gt;
  &lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/h3&gt;
&lt;p&gt;3. Update the method that checks what classes should use what interceptors (MatchesType() method in the StructureMapInterceptor class above)&lt;/p&gt;
&lt;h3&gt;
  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; MatchesType(Type type)
{
      &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (type.IsSealed)
           &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
      var attributes = System.Attribute.GetCustomAttributes(type); 
      &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (attributes.Any(a =&amp;gt; a &lt;span class=&quot;kwrd&quot;&gt;is&lt;/span&gt; LogAttribute))
      {
           &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
      }              
      &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
}&lt;/pre&gt;
  &lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/h3&gt;
&lt;p&gt;4. Lean back and enjoy the little log messages ticking in...&lt;/p&gt;
&lt;h3&gt;Bonus material 2; Manual creation of proxy classes without an IoC container&lt;/h3&gt;
&lt;p&gt;Of course it’s also possible to use the ProxyGenerator class from Castle to “manually” generate a matching decorator class. &lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;var newsRepository = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; NewsRepository();
var proxyGenerator = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ProxyGenerator();
var newsRepositoryWithLogging = 
           (INewsRepository)proxyGenerator.CreateInterfaceProxyWithTargetInterface(
            newsRepository.GetType().GetInterfaces().First(),
            newsRepository.GetType().GetInterfaces(), newsRepository,
            &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; LoggingInterceptor());
var items = newsRepositoryWithLogging.GetAllNews();&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;Performance will definitely need some careful consideration when doing this manually though. Wrapping the above in a factory for class creation will help of course, combined with the singleton pattern to avoid doing it too often. But to be honest, using an IoC container makes much more sense to handle object creation when using AOP so regard the last example as a more theoretical exploration. &lt;/p&gt;
&lt;p&gt;Happy coding again!&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>How to create a nice looking admin plugin</title>
        <link href="http://world.episerver.com/Blogs/Per-Nergard/Dates/2013/4/How-to-create-a-nice-looking-admin-plugin/" />
        <id>http://world.episerver.com/Blogs/Per-Nergard/Dates/2013/4/How-to-create-a-nice-looking-admin-plugin/</id>
        <updated>2013-04-05T03:57:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;Creating an admin plugin is easy. But making it look good and&amp;#160; blend in&amp;#160; with the core components isn’t documented at all.&lt;/p&gt;  &lt;p&gt;In this blog post I will try to shed some light on how to achieve the EPiServer built in look and feel. &lt;/p&gt;  &lt;h2&gt;Initial setup&lt;/h2&gt;  &lt;p&gt;After creating your plugin make the following 3 changes. Credit to Dan Mathews who blogged about it first.&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;1. Inherit the EPiServer.UI.SystemPageBase (You need to add a reference to the EPiServer.UI assembly.&lt;/p&gt;  &lt;p&gt;2. Use the EPiServer UI masterpage. &lt;/p&gt;  &lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnPreInit(EventArgs e)
{
  &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnPreInit(e);
  &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.MasterPageFile = ResolveUrlFromUI(&lt;span class=&quot;str&quot;&gt;&amp;quot;MasterPages/EPiServerUI.master&amp;quot;&lt;/span&gt;);
}&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;3. Register the following in system.web-pages-controls in web.config&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;tagPrefix&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServerUI&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;namespace&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServer.UI.WebControls&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;assembly&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServer.UI&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt; 
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;tagPrefix&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServerScript&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;namespace&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServer.ClientScript.WebControls&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;assembly&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServer&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;add&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;tagPrefix&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServerScript&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;namespace&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServer.UI.ClientScript.WebControls&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;assembly&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPiServer.UI&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;h2&gt;Heading and description&lt;/h2&gt;
&lt;p&gt;To add a header and intro text to your plugin you can set it via the following in OnPreInit.&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.SystemMessageContainer.Heading = &lt;span class=&quot;str&quot;&gt;&amp;quot;Example heading&amp;quot;&lt;/span&gt;; 
&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.SystemMessageContainer.Description = &lt;span class=&quot;str&quot;&gt;&amp;quot;Introduction text&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/36482/2013/04/05/Headlineandintro.jpg&quot;&gt;&lt;img title=&quot;Headlineandintro&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;Headlineandintro&quot; src=&quot;/Globals/xmlrpc/36482/2013/04/05/Headlineandintro_thumb.jpg&quot; width=&quot;576&quot; height=&quot;61&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;h1&gt;&lt;/h1&gt;
&lt;h2&gt;Contentplaceholder&lt;/h2&gt;
&lt;p&gt;When creating your plugin you need to add the front-end code to the MainRegion contentplaceholder.&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;asp:content contentplaceholderid=&lt;span class=&quot;str&quot;&gt;&amp;quot;MainRegion&amp;quot;&lt;/span&gt; runat=&lt;span class=&quot;str&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;div class=&amp;quot;epi-formArea epi-paddingHorizontal&amp;quot;&amp;gt;&lt;/pre&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;p&gt;You need the “epi-formArea” on the div containing the code or else everything will go bananas.&lt;/p&gt;
&lt;p&gt;The “epi-paddingHorizontal” does exactly what is says so removing it will start everything at the left side.&lt;/p&gt;
&lt;h2&gt;Grouping&lt;/h2&gt;
&lt;p&gt;If you would like to create a nice group of content with a heading just create a fieldset.&lt;/p&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
  &lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;fieldset&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;legend&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Group heading&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;legend&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dl&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Plugins&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dd&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Are fun to build&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dd&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;GUI&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dt&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dd&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Now with nice looks&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dd&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;dl&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;floatright&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;episerverui:toolbutton&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;SettingsButton&amp;quot;&lt;/span&gt; &lt;/pre&gt;
  &lt;blockquote&gt;
    &lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;/pre&gt;
    &lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;&amp;lt;%$ Resources: EPiServer, button.settings %&amp;gt;&amp;quot;&lt;/span&gt; &lt;/pre&gt;
    &lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;tooltip&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;&amp;lt;%$ Resources: EPiServer, button.settings %&amp;gt;&amp;quot;&lt;/span&gt; &lt;/pre&gt;
    &lt;pre&gt;&lt;span class=&quot;attr&quot;&gt;skinid&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;File&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/blockquote&gt;
  &lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;fieldset&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Example with and without “floatright” and “epi-paddingHorizontal”..&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/36482/2013/04/05/grouping.jpg&quot;&gt;&lt;img title=&quot;grouping&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;grouping&quot; src=&quot;/Globals/xmlrpc/36482/2013/04/05/grouping_thumb.jpg&quot; width=&quot;570&quot; height=&quot;186&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;Tabs&lt;/h2&gt;
&lt;p&gt;If you want to create tabs you first need to create a tabstrip. The target id need to be set and point to a asp panel. The “epi-padding” class on the panel creates a horizontal padding below the tabs and the content.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tabstrip&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;lt;EPiServerUI:TabStrip  runat=&lt;span class=&quot;str&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; id=&lt;span class=&quot;str&quot;&gt;&amp;quot;actionTab&amp;quot;&lt;/span&gt; EnableViewState=&lt;span class=&quot;str&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt; GeneratesPostBack=&lt;span class=&quot;str&quot;&gt;&amp;quot;False&amp;quot;&lt;/span&gt; targetid=&lt;span class=&quot;str&quot;&gt;&amp;quot;tabView&amp;quot;&lt;/span&gt; supportedpluginarea=&lt;span class=&quot;str&quot;&gt;&amp;quot;SystemSettings&amp;quot;&lt;/span&gt;&amp;gt;
    &amp;lt;EPiServerUI:Tab Text=&lt;span class=&quot;str&quot;&gt;&amp;quot;Tab1&amp;quot;&lt;/span&gt; runat=&lt;span class=&quot;str&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span class=&quot;str&quot;&gt;&amp;quot;Tab1&amp;quot;&lt;/span&gt; /&amp;gt;
    &amp;lt;EPiServerUI:Tab Text=&lt;span class=&quot;str&quot;&gt;&amp;quot;Tab2&amp;quot;&lt;/span&gt;  runat=&lt;span class=&quot;str&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span class=&quot;str&quot;&gt;&amp;quot;Tab2&amp;quot;&lt;/span&gt; /&amp;gt;
&amp;lt;/EPiServerUI:TabStrip&amp;gt;
&amp;lt;asp:Panel runat=&lt;span class=&quot;str&quot;&gt;&amp;quot;server&amp;quot;&lt;/span&gt; ID=&lt;span class=&quot;str&quot;&gt;&amp;quot;tabView&amp;quot;&lt;/span&gt; CssClass=&lt;span class=&quot;str&quot;&gt;&amp;quot;epi-padding&amp;quot;&lt;/span&gt;&amp;gt;
&amp;lt;/asp:Panel&amp;gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/36482/2013/04/05/tabs.jpg&quot;&gt;&lt;img title=&quot;tabs&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;tabs&quot; src=&quot;/Globals/xmlrpc/36482/2013/04/05/tabs_thumb.jpg&quot; width=&quot;218&quot; height=&quot;68&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To add content to each tab you add a runat=”server” controls in the panel. The first equals tab1 and so forth.&lt;/p&gt;
&lt;h3&gt;&lt;/h3&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tab 1 – general content&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
  &lt;pre class=&quot;alt&quot;&gt;       &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;epi-formArea&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;GeneralTable&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;epi-size25&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;AssociatedControlID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPsSiteName&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Label&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Columns&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;50&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPsSiteName&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;               &lt;/pre&gt;
  &lt;pre&gt;                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;epi-indent&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:CheckBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPfEncryptSensitiveInformation&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;server&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:CheckBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Label3&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;AssociatedControlID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;EPfEncryptSensitiveInformation&amp;quot;&lt;/span&gt; &lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;                        &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Label&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;    &lt;/pre&gt;
&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Class “epi-size25” creates the spacing between the first label and the textbox.&lt;/p&gt;
&lt;p&gt;To push the content to right you use the “epi-indent” class.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/36482/2013/04/05/tab1.jpg&quot;&gt;&lt;img title=&quot;tab1&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;tab1&quot; src=&quot;/Globals/xmlrpc/36482/2013/04/05/tab1_thumb.jpg&quot; width=&quot;576&quot; height=&quot;92&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tab 2 – tables&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can create nice tables manually or using for example a gridview. If creating a table manually you need to have the class “epi-default” on the table.&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;epi-default&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;thead&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Header 1&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;Header 2&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;thead&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;row 1, cell 1&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;row 1, cell 2&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;row 2, cell 1&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;row 2, cell 2&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/36482/2013/04/05/tab2.jpg&quot;&gt;&lt;img title=&quot;tab2&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;tab2&quot; src=&quot;/Globals/xmlrpc/36482/2013/04/05/tab2_thumb.jpg&quot; width=&quot;578&quot; height=&quot;107&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Buttons&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The tab solution won’t be complete without at least one button to let the user commit some changes ore something like that. Adding the code below with give you a horizontal line and a right floating button.&lt;/p&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;epi-buttonContainer&amp;quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
   &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;EPiServerUI:ToolButton&lt;/span&gt;  &lt;span class=&quot;attr&quot;&gt;DisablePageLeaveCheck&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;   &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;server&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;SkinID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Save&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Save&amp;quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ToolTip&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&amp;quot;Tip&amp;quot;&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, &quot;Courier New&quot;, courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;&lt;a href=&quot;/Globals/xmlrpc/36482/2013/04/05/tabbutton.jpg&quot;&gt;&lt;img title=&quot;tabbutton&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;tabbutton&quot; src=&quot;/Globals/xmlrpc/36482/2013/04/05/tabbutton_thumb.jpg&quot; width=&quot;590&quot; height=&quot;150&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;Notice the SkinID attribute. There exist a lot of toolbutton skins. You can check out which exist in the Toolbutton.skin file in folder (64 bit os) : C:\Program Files (x86)\EPiServer\CMS\7.0.586.1\Application\App_Themes\Default&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;h2&gt;&lt;/h2&gt;
&lt;h2&gt;Jquery&lt;/h2&gt;
&lt;p&gt;Jquery is automatically included and ready&amp;#160; to use in your plugin.&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;I’ve added the example code to the &lt;a href=&quot;http://world.episerver.com/Code/Per-Nergard/Example-on-how-to-build-a-nice-looking-admin-plugin/&quot; target=&quot;_blank&quot;&gt;code section&lt;/a&gt; to make it easier to get started..&lt;/p&gt;</summary>
    </entry>    <entry>
        <title>Scheduled Jobs not running after site upgrade</title>
        <link href="http://blog.nansen.com/2013/04/scheduled-jobs-not-running-after-site.html" />
        <id>http://blog.nansen.com/2013/04/scheduled-jobs-not-running-after-site.html</id>
        <updated>2013-04-04T14:24:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;After an upgrade of a customer site from EPiServer 5 to EPiServer 6 all scheduled jobs stopped working in all  environments. When debugging the scheduling service (in a command prompt run &quot;EPiServer.SchedulerSvc.exe DEBUG&quot; in the service directory) we noticed that when the service tried to connect to the site it failed with the following error message,&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#INF# [_LM_W3SVC_1_ROOT] Failed calling site (Attempting to deserialize an empty stream.)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;We tried to clear the &quot;EPiServer.SchedulerService.Sites.xml&quot; file to force a re-registration of the site but it never registered. After some thinking and contact with EPiServer support we found the fault, a missing module in Web.config. When we added the &quot;FirstBeginRequestModule&quot; module to the modules section everything started working again. &lt;/p&gt;&lt;pre class=&quot;brush: xml; highlight: [4];&quot;&gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;system.webServer&amp;gt;&lt;br /&gt;    &amp;lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;&gt;&lt;br /&gt;      &amp;lt;add name=&quot;FirstBeginRequestModule&quot; precondition=&quot;managedHandler&quot; type=&quot;EPiServer.Web.InitializationModule, EPiServer&quot;&amp;gt;&lt;br /&gt;    &amp;lt;/modules&amp;gt;&lt;br /&gt;  &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;/pre&gt;</summary>
    </entry>    <entry>
        <title>EPiServer CMS 7 logical architecture diagram</title>
        <link href="http://www.markeverard.com/?p=1992" />
        <id>http://www.markeverard.com/?p=1992</id>
        <updated>2013-04-04T10:30:12.0000000Z</updated>
        <summary type="html">I often have to describe the logical components of EPiServer CMS to clients and customers. It always feel like I end up recreating a logical architecture diagram on each occasion. The best place to keep something so that you never lose it, is in a place where it&amp;#8217;s easy to find. Anything on the web [...]</summary>
    </entry>    <entry>
        <title>Hiding seen ChangeInfo in an EPiServer CMS 6 R2 Solution</title>
        <link href="http://andersnordby.wordpress.com/?p=495" />
        <id>http://andersnordby.wordpress.com/?p=495</id>
        <updated>2013-04-04T06:38:44.0000000Z</updated>
        <summary type="html">This post is mostly a reminder to myself about how to achieve this. The task In addition to marking a page as changed, the customer wanted the editors to be able to show the users a description of what is new/updated. The customer also wanted users to be able to mark the message as seen. [...]&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=andersnordby.wordpress.com&amp;#038;blog=35391241&amp;#038;post=495&amp;#038;subd=andersnordby&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</summary>
    </entry>    <entry>
        <title>How to disable CMS edit/admin mode on &quot;public facing&quot; servers in a load balanced environment</title>
        <link href="http://blog.nansen.com/2013/04/how-to-disable-cms-editadmin-mode-on.html" />
        <id>http://blog.nansen.com/2013/04/how-to-disable-cms-editadmin-mode-on.html</id>
        <updated>2013-04-03T20:54:00.0000000Z</updated>
        <summary type="html">Hi Folks!&lt;br /&gt;&lt;br /&gt;I realize that there have been several other blog posts regarding this topic, but after lots or trial and error I believe I have found a solid approach for disabling CMS edit/admin mode on public facing IIS servers in a &lt;i&gt;load balanced environment&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;There are other techniques that can be used to secure CMS edit/admin modes in a single server environment. &amp;nbsp;&lt;a href=&quot;http://www.david-tec.com/2010/09/Securing-EPiServer-edit-and-admin-mode-by-IP-address/&quot;&gt;Check out this blog post by David Knipe&lt;/a&gt; for additional information. &amp;nbsp;It essentially uses IP white lists at the IIS level. &amp;nbsp;Maintaining IP whitelists can be problematic, so I prefer having a dedicated CMS server that&#39;s only accessible within the internal network.&lt;br /&gt;&lt;br /&gt;In &lt;a href=&quot;http://blog.nansen.com/2013/04/how-to-configure-episerver-load.html&quot;&gt;my last blog post&lt;/a&gt; we covered how to setup EPiServer load balancing using net.tcp. &amp;nbsp;We also detailed the three basic models that can be used when implementing EPiServer load balancing. &amp;nbsp;Today we&#39;ll be focusing on the Security model.&lt;br /&gt;&lt;br /&gt;To recap, the security model provides a dedicated server for CMS editors to connect to and make changes to CMS content. &amp;nbsp;This server is normally only accessible from within the company&#39;s internal network. &amp;nbsp;The one or more &quot;public facing&quot; servers are what the general public connects to. &amp;nbsp;These &quot;public facing&quot; servers have the CMS edit/admin mode completely disabled.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-PWGx8XSmm4M/UVs7nqWr8NI/AAAAAAAAJqU/ivkwpR0yu_0/s1600/EW_Diagram2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;http://3.bp.blogspot.com/-PWGx8XSmm4M/UVs7nqWr8NI/AAAAAAAAJqU/ivkwpR0yu_0/s320/EW_Diagram2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;Let&#39;s say we have our CMS server available onon&lt;b&gt; http://cms.mysite.com&amp;nbsp;&lt;/b&gt;(internal network only), and our &quot;public facing&quot; server available on &lt;b&gt;http://www.mysite.com&lt;/b&gt;, then...&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;http://cms.mysite.com/episerver&lt;/b&gt; would prompt for login, and if the credentials are correct, allow the individual to navigate to CMS edit/admin mode.&lt;/li&gt;&lt;li&gt;&lt;b&gt;http://www.mysite.com/episerver &lt;/b&gt;would be completely disabled, even if the user managed to steal a CMS editor&#39;s credentials.&lt;/li&gt;&lt;/ul&gt;Some of my Swedish&amp;nbsp;colleagues&amp;nbsp;have told me that this sort of setup is not very common in Sweden. &amp;nbsp;But I&#39;ve personally noticed that many of our clients here in the States prefer having a dedicated CMS editor server. &amp;nbsp;I can&#39;t say I blame them.&lt;br /&gt;&lt;br /&gt;So how do we harden the &quot;public facing&quot; servers. &amp;nbsp;It&#39;s remarkably easy. &amp;nbsp;All you have to do is make some tweaks to the Web.config file on the public facing server(s).&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Disclaimer: these instructions work for EPiServer CMS 6 R2, I&#39;m not sure about EPiServer CMS 7, but I believe the premise is essentially the same thing.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Web.config changes&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;The idea here is to modify any &lt;b&gt;&amp;lt;location&amp;gt;&lt;/b&gt; element in the Web.config which currently requires &lt;b&gt;WebEditors&lt;/b&gt;,&amp;nbsp;&lt;b&gt;WebAdmins &lt;/b&gt;or &lt;b&gt;Administrators&amp;nbsp;&lt;/b&gt;role membership to access.&lt;br /&gt;&lt;br /&gt;For example, the &lt;b&gt;&amp;lt;location&amp;gt;&lt;/b&gt; element for &quot;&lt;b&gt;/episerver&lt;/b&gt;&quot; access by default looks like:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml; highlight: [13];&quot;&gt;&amp;lt;location path=&quot;episerver&quot;&amp;gt;&lt;br /&gt;  &amp;lt;system.web&amp;gt;&lt;br /&gt;    &amp;lt;httpRuntime maxRequestLength=&quot;1000000&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;pages enableEventValidation=&quot;true&quot;&amp;gt;&lt;br /&gt;      &amp;lt;controls&amp;gt;&lt;br /&gt;        &amp;lt;add tagPrefix=&quot;EPiServerUI&quot; namespace=&quot;EPiServer.UI.WebControls&quot; assembly=&quot;EPiServer.UI&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;add tagPrefix=&quot;EPiServerScript&quot; namespace=&quot;EPiServer.ClientScript.WebControls&quot; assembly=&quot;EPiServer&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;add tagPrefix=&quot;EPiServerScript&quot; namespace=&quot;EPiServer.UI.ClientScript.WebControls&quot; assembly=&quot;EPiServer.UI&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;/controls&amp;gt;&lt;br /&gt;    &amp;lt;/pages&amp;gt;&lt;br /&gt;    &amp;lt;globalization requestEncoding=&quot;utf-8&quot; responseEncoding=&quot;utf-8&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;authorization&amp;gt;&lt;br /&gt;      &amp;lt;allow roles=&quot;WebEditors, WebAdmins, Administrators&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;deny users=&quot;*&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/authorization&amp;gt;&lt;br /&gt;  &amp;lt;/system.web&amp;gt;&lt;br /&gt;  &amp;lt;system.webServer&amp;gt;&lt;br /&gt;    &amp;lt;handlers&amp;gt;&lt;br /&gt;      &amp;lt;clear /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;webresources&quot; path=&quot;WebResource.axd&quot; verb=&quot;GET&quot; type=&quot;System.Web.Handlers.AssemblyResourceLoader&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;PageHandlerFactory-Integrated&quot; path=&quot;*.aspx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;System.Web.UI.PageHandlerFactory&quot; modules=&quot;ManagedPipelineHandler&quot; scriptProcessor=&quot;&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;integratedMode&quot; responseBufferLimit=&quot;4194304&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;SimpleHandlerFactory-Integrated&quot; path=&quot;*.ashx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;System.Web.UI.SimpleHandlerFactory&quot; modules=&quot;ManagedPipelineHandler&quot; scriptProcessor=&quot;&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;integratedMode&quot; responseBufferLimit=&quot;4194304&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;WebServiceHandlerFactory-Integrated&quot; path=&quot;*.asmx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; modules=&quot;ManagedPipelineHandler&quot; scriptProcessor=&quot;&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;integratedMode&quot; responseBufferLimit=&quot;4194304&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;wildcard&quot; path=&quot;*&quot; verb=&quot;*&quot; type=&quot;EPiServer.Web.StaticFileHandler, EPiServer&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/handlers&amp;gt;&lt;br /&gt;  &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;&amp;lt;/location&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Notice that the &lt;b&gt;&amp;lt;allow&amp;gt;&lt;/b&gt; element&amp;nbsp;currently&amp;nbsp;specifies&amp;nbsp;that &lt;b&gt;WebEditors&lt;/b&gt;, &lt;b&gt;WebAdmins&lt;/b&gt;, and &lt;b&gt;Administrators &lt;/b&gt;can access this location. &amp;nbsp;The &lt;b&gt;&amp;lt;deny&amp;gt;&lt;/b&gt; elements tells IIS to deny everyone else.&lt;br /&gt;&lt;br /&gt;All we&amp;nbsp;essentially&amp;nbsp;have to do is remove the &lt;b&gt;&amp;lt;allow&amp;gt;&lt;/b&gt; element (comment it out) on the public facing servers and this location will be denied to everyone - including CMS editors/admins. &amp;nbsp;This means even if someone managed to steal the username and password of a CMS editor, they wouldn&#39;t be able to login to CMS edit mode unless they were somehow connected to the internal network and knew the URL to the CMS web application instance.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Please note: you can easily use &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd465326.aspx&quot;&gt;Visual Studio transforms&lt;/a&gt; to create a Solution Configuration which automatically removes the &lt;b&gt;&amp;lt;allow&amp;gt;&lt;/b&gt; element when publishing to the &quot;public facing&quot; servers. &amp;nbsp;We&#39;ll take a closer look at transforms in my next blog post.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Here we&#39;ve commented out the &lt;b&gt;&amp;lt;allow&amp;gt;&lt;/b&gt; element for the &lt;b&gt;&amp;lt;location path=&quot;episerver&quot;&amp;gt;&lt;/b&gt; element.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml; highlight: [13];&quot;&gt;&amp;lt;location path=&quot;episerver&quot;&amp;gt;&lt;br /&gt;  &amp;lt;system.web&amp;gt;&lt;br /&gt;    &amp;lt;httpRuntime maxRequestLength=&quot;1000000&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;pages enableEventValidation=&quot;true&quot;&amp;gt;&lt;br /&gt;      &amp;lt;controls&amp;gt;&lt;br /&gt;        &amp;lt;add tagPrefix=&quot;EPiServerUI&quot; namespace=&quot;EPiServer.UI.WebControls&quot; assembly=&quot;EPiServer.UI&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;add tagPrefix=&quot;EPiServerScript&quot; namespace=&quot;EPiServer.ClientScript.WebControls&quot; assembly=&quot;EPiServer&quot; /&amp;gt;&lt;br /&gt;        &amp;lt;add tagPrefix=&quot;EPiServerScript&quot; namespace=&quot;EPiServer.UI.ClientScript.WebControls&quot; assembly=&quot;EPiServer.UI&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;/controls&amp;gt;&lt;br /&gt;    &amp;lt;/pages&amp;gt;&lt;br /&gt;    &amp;lt;globalization requestEncoding=&quot;utf-8&quot; responseEncoding=&quot;utf-8&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;authorization&amp;gt;&lt;br /&gt;      &amp;lt;!--&amp;lt;allow roles=&quot;WebEditors, WebAdmins, Administrators&quot; /&amp;gt;--&amp;gt;&lt;br /&gt;      &amp;lt;deny users=&quot;*&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/authorization&amp;gt;&lt;br /&gt;  &amp;lt;/system.web&amp;gt;&lt;br /&gt;  &amp;lt;system.webServer&amp;gt;&lt;br /&gt;    &amp;lt;handlers&amp;gt;&lt;br /&gt;      &amp;lt;clear /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;webresources&quot; path=&quot;WebResource.axd&quot; verb=&quot;GET&quot; type=&quot;System.Web.Handlers.AssemblyResourceLoader&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;PageHandlerFactory-Integrated&quot; path=&quot;*.aspx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;System.Web.UI.PageHandlerFactory&quot; modules=&quot;ManagedPipelineHandler&quot; scriptProcessor=&quot;&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;integratedMode&quot; responseBufferLimit=&quot;4194304&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;SimpleHandlerFactory-Integrated&quot; path=&quot;*.ashx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;System.Web.UI.SimpleHandlerFactory&quot; modules=&quot;ManagedPipelineHandler&quot; scriptProcessor=&quot;&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;integratedMode&quot; responseBufferLimit=&quot;4194304&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;WebServiceHandlerFactory-Integrated&quot; path=&quot;*.asmx&quot; verb=&quot;GET,HEAD,POST,DEBUG&quot; type=&quot;System.Web.Services.Protocols.WebServiceHandlerFactory, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; modules=&quot;ManagedPipelineHandler&quot; scriptProcessor=&quot;&quot; resourceType=&quot;Unspecified&quot; requireAccess=&quot;Script&quot; allowPathInfo=&quot;false&quot; preCondition=&quot;integratedMode&quot; responseBufferLimit=&quot;4194304&quot; /&amp;gt;&lt;br /&gt;      &amp;lt;add name=&quot;wildcard&quot; path=&quot;*&quot; verb=&quot;*&quot; type=&quot;EPiServer.Web.StaticFileHandler, EPiServer&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/handlers&amp;gt;&lt;br /&gt;  &amp;lt;/system.webServer&amp;gt;&lt;br /&gt;&amp;lt;/location&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You should repeat this step for all &lt;b&gt;&amp;lt;location&amp;gt;&lt;/b&gt; objects that currently require &lt;b&gt;WebEditors&lt;/b&gt;, &lt;b&gt;WebAdmins&lt;/b&gt;, or &lt;b&gt;Adminstrators &lt;/b&gt;role membership.&lt;br /&gt;&lt;br /&gt;Depending on whether or not your using Commerce and/or Composer you might have to make the changes to the&lt;b&gt; &amp;lt;location&amp;gt;&lt;/b&gt; elements with the following paths:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;episerver&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;episerver/CMS/admin&quot; &amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;WebServices&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;Admin/SettingsPlugin&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;Admin/SitePlugin&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;Edit&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;EPiServerCommon&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;dropit/plugin/extension/ui/edit&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;&amp;lt;location path=&quot;dropit/plugin/extension/ui/admin&quot;&amp;gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;After doing this, you&#39;ll notice one serious and annoying problem...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-r8C9W-xBzaY/UVySaZBYDDI/AAAAAAAAJq0/Iv_u5-m4rpc/s1600/Capture2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;http://2.bp.blogspot.com/-r8C9W-xBzaY/UVySaZBYDDI/AAAAAAAAJq0/Iv_u5-m4rpc/s320/Capture2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Assuming someone is able to login using CMS editor credentials, they can still access the EPiServer context menu (for on page editing), even if they cannot get to CMS edit/admin mode.&lt;br /&gt;&lt;br /&gt;This is because the &amp;lt;location&amp;gt; elements don&#39;t affect access to the context menu. &amp;nbsp;The context menu is driven by EPiServer ACLs.&lt;br /&gt;&lt;br /&gt;I stumbled across the solution &lt;a href=&quot;http://paulhoughton.org/blog/disable-episerver-editadmin-secure-paths-on-front-end-servers/&quot;&gt;on this blog post by Paul Houghton&lt;/a&gt;. &amp;nbsp;It requires building some code which will disable the EPiServer context menus for all page templates and then using &lt;b&gt;appSettings &lt;/b&gt;to control whether or not this code should execute. &amp;nbsp;You could then configure the &lt;b&gt;appSettings &lt;/b&gt;in Web.config for the servers where you want to disable the context menu appropriately.&lt;br /&gt;&lt;br /&gt;Well &lt;b&gt;appSettings &lt;/b&gt;was fine and dandy several years ago, but these days we use project level application settings. &amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/2350893/appsettings-vs-applicationsettings-appsettings-outdated&quot;&gt;See this post on Stackoverflow&lt;/a&gt; for addition information on the differences between &lt;b&gt;appSettings &lt;/b&gt;and &lt;b&gt;application settings&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;So let&#39;s build a boolean application setting for our project in Visual Studio.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/--vt6rVWr8KE/UVyOfgPjbkI/AAAAAAAAJqk/6MRc8kiO1-s/s1600/Capture.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;134&quot; src=&quot;http://4.bp.blogspot.com/--vt6rVWr8KE/UVyOfgPjbkI/AAAAAAAAJqk/6MRc8kiO1-s/s320/Capture.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now we can add some code in &lt;b&gt;PageBase.cs&lt;/b&gt; (which all of our EPiServer templates inherit from) to override the &lt;b&gt;onInit()&lt;/b&gt; page life cycle method. &amp;nbsp;This code checks the application settings value and determines if it should enable or disable the EPiServer context menu.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: csharp;&quot;&gt;namespace MySite.Core&lt;br /&gt;{&lt;br /&gt;    public abstract class PageBase&amp;lt;T&amp;gt; : TemplatePage&amp;lt;T&amp;gt; where T : PageTypeBase&lt;br /&gt;    {&lt;br /&gt;        protected override void OnInit(System.EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (ContextMenu != null &amp;amp;&amp;amp; !Settings.Default.EnableEPiContextMenu)&lt;br /&gt;            {&lt;br /&gt;                ContextMenu.IsMenuEnabled = false;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            base.OnInit(e);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The great part about application settings is that the values are compiled into the DLL, &lt;b&gt;but can be overriden via the Web.config&lt;/b&gt;. &amp;nbsp;If you don&#39;t supply a value in Web.config, the compiled in value is used. &amp;nbsp;Pretty cool huh?&lt;br /&gt;&lt;br /&gt;So now all we have to do is override the &quot;True&quot; value for our EnableEPiContextMenu in the Web.config on our public facing servers.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml; highlight: [4];&quot;&gt;&amp;lt;applicationSettings&amp;gt;&lt;br /&gt;  &amp;lt;MySite.Core.Properties.Settings&amp;gt;&lt;br /&gt;    &amp;lt;setting name=&quot;EnableEPiContextMenu&quot; serializeAs=&quot;String&quot;&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;False&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/setting&amp;gt;&lt;br /&gt;  &amp;lt;/MySite.Core.Properties.Settings&amp;gt;&lt;br /&gt;&amp;lt;/applicationSettings&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Extra steps for sites that don&#39;t require login functionality&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If your site literally does not require any sort of login functionality for the general public you can further secure your &quot;public facing&quot; severs by disabling the login page completely. &amp;nbsp;You would keep the login page for the CMS server so that your CMS editors can login.&lt;br /&gt;&lt;br /&gt;If you go this route, a person from the general public going to &lt;b&gt;http://www.mysite.com/episerver&lt;/b&gt; would get a 404. &amp;nbsp;This is because:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;IIS determines the user is going to a location path that requires login.&lt;/li&gt;&lt;li&gt;IIS tries to respond with the login page defined in the &lt;b&gt;&amp;lt;forms&amp;gt;&lt;/b&gt; element in Web.config.&lt;/li&gt;&lt;li&gt;IIS can&#39;t find the login page and therefore returns a 404.&lt;/li&gt;&lt;/ol&gt;If you are using the standard EPiServer login page, you can comment out this line in &lt;b&gt;episerver.config&lt;/b&gt;. &amp;nbsp;This disables the virtual path to &quot;~&lt;b&gt;/Util&lt;/b&gt;&quot; where the EPiServer login page is stored.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml; highlight: [14,15,16];&quot;&gt;&amp;lt;virtualPath customFileSummary=&quot;~/FileSummary.config&quot;&amp;gt;&lt;br /&gt;    &amp;lt;providers&amp;gt;&lt;br /&gt;        ... more ...    &lt;br /&gt;        &lt;br /&gt;          &lt;br /&gt;        &amp;lt;add name=&quot;App_Themes_Default&quot; virtualPath=&quot;~/App_Themes/Default/&quot;&lt;br /&gt;physicalPath=&quot;C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\App_Themes\Default&quot;&lt;br /&gt;type=&quot;EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer&quot; /&amp;gt;&lt;br /&gt;            &lt;br /&gt;        &amp;lt;add name=&quot;UI&quot; virtualPath=&quot;~/episerver/CMS/&quot;&lt;br /&gt;physicalPath=&quot;C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\UI\CMS&quot;&lt;br /&gt;type=&quot;EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer&quot; /&amp;gt;&lt;br /&gt;            &lt;br /&gt;        &amp;lt;!--&amp;lt;add name=&quot;UtilFiles&quot; virtualPath=&quot;~/Util/&quot;&lt;br /&gt;physicalPath=&quot;C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\application\util&quot;&lt;br /&gt;type=&quot;EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider,EPiServer&quot; /&amp;gt;--&amp;gt;&lt;br /&gt;&lt;br /&gt;        ... more ...&lt;br /&gt;&lt;br /&gt;    &amp;lt;/providers&amp;gt;&lt;br /&gt;&amp;lt;/virtualPath&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If you are using a custom login page, just remove it from the build you publish to your &quot;public&quot; facing servers.&lt;br /&gt;&lt;br /&gt;That about does it folks. &amp;nbsp;Tune in next time for how to use Visual Studio transforms to easily customize Visual Studio publish configurations. &amp;nbsp;This allows you to make configuration changes automatically when publishing builds of your web application to different servers: DEV, TEST, CMS, and PROD.&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;Rob</summary>
    </entry>    <entry>
        <title>Add custom fields to the EPiServer Search index with EPiServer 7</title>
        <link href="http://tedgustaf.com//link/29e9128b9eca426d84db27a1b792b1ef.aspx?id=317&amp;epslanguage=en" />
        <id>http://tedgustaf.com//link/29e9128b9eca426d84db27a1b792b1ef.aspx?id=317&amp;epslanguage=en</id>
        <updated>2013-04-02T14:28:01.0000000Z</updated>
        <summary type="html">If you have an EPiServer 7 site with basic search requirements not warranting the full blown EPiServer Find search engine, you can come a long way with EPiServer Search and some customized indexing.&lt;img src=&quot;http://feeds.feedburner.com/~r/episerver/~4/jz8_wtEhZV8&quot; height=&quot;1&quot; width=&quot;1&quot; /&gt;</summary>
    </entry>    <entry>
        <title>EPiServer 7 example properties</title>
        <link href="http://krzysztofmorcinek.wordpress.com/?p=1731" />
        <id>http://krzysztofmorcinek.wordpress.com/?p=1731</id>
        <updated>2013-04-02T12:49:07.0000000Z</updated>
        <summary type="html">Welcome EPiServer This is my first post about EPiServer 7. For those who are not familiar, its a CMS and we are using it at Making Waves. If you are not using it at work, this and other posts about &amp;#8230; &lt;a href=&quot;http://krzysztofmorcinek.wordpress.com/2013/04/02/episerver-7-example-properties/&quot;&gt;Czytaj dalej &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://stats.wordpress.com/b.gif?host=krzysztofmorcinek.wordpress.com&amp;#038;blog=22371011&amp;#038;post=1731&amp;#038;subd=krzysztofmorcinek&amp;#038;ref=&amp;#038;feed=1&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;</summary>
    </entry>    <entry>
        <title>How to Configure EPiServer Load Balancing with net.tcp</title>
        <link href="http://blog.nansen.com/2013/04/how-to-configure-episerver-load.html" />
        <id>http://blog.nansen.com/2013/04/how-to-configure-episerver-load.html</id>
        <updated>2013-04-01T21:50:00.0000000Z</updated>
        <summary type="html">EPiServer load balancing configuration is critical for large scale enterprise deployments. It allows you to have multiple IIS servers that all connect to same database.&lt;br /&gt;&lt;br /&gt;There three main models that can be used when using EPiServer load balancing.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Performance&lt;/b&gt; – When most people here the term &quot;load balancing&quot; they think of the performance benefits that can be obtained. Using the performance model you will be splitting the incoming connections up between two or more IIS servers – each one running a copy of the web application. Using this model requires a minimum of two IIS servers. A hardware load balancer is normally also involved.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-mYbwgmn8V6o/UVn7EPpY-OI/AAAAAAAAJps/qeofC0_lFRo/s1600/EW_Diagram1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;290&quot; src=&quot;http://3.bp.blogspot.com/-mYbwgmn8V6o/UVn7EPpY-OI/AAAAAAAAJps/qeofC0_lFRo/s320/EW_Diagram1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Security&lt;/b&gt; – Most people don’t think of using EPiServer load balancing to help with security, but I’ve found this is actually one of the primary benefits of load balancing. The idea here is to have one dedicated CMS IIS server, and one our more public facing IIS servers. The CMS IIS Server is normally only accessible via the company’s internal network. The public facing server(s) have the CMS edit/admin mode completely disabled. This model requires a minimum of two IIS servers.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://1.bp.blogspot.com/-uheVVVspT68/UVn7HxNaxcI/AAAAAAAAJp0/plwbocarbkU/s1600/EW_Diagram2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;http://1.bp.blogspot.com/-uheVVVspT68/UVn7HxNaxcI/AAAAAAAAJp0/plwbocarbkU/s320/EW_Diagram2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. Performance and Security&lt;/b&gt; – A hybrid of the two above models, requires a minimum of three IIS servers.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://4.bp.blogspot.com/-jQjpQUIWahk/UVn7LJyFyUI/AAAAAAAAJp8/-DbDFQ6mKXw/s1600/EW_Diagram3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;http://4.bp.blogspot.com/-jQjpQUIWahk/UVn7LJyFyUI/AAAAAAAAJp8/-DbDFQ6mKXw/s320/EW_Diagram3.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Note that technically you can also performance load balance the CMS IIS severs, but this is overkill in most cases. Unless of course you have an army of CMS editors maintaining the site.&lt;br /&gt;&lt;br /&gt;There are already other blog posts on how to setup EPiServer load balancing using the preferred method, UDP Multicasting. I would be happy to create another blog post of this if there is demand, but the focus of this blog post is how to setup EPiServer load balancing when UPD Multicasting is not an option. In this case you need to use net.tcp.&lt;br /&gt;&lt;br /&gt;I&#39;ve had the privilege of setting up all three of the above models with both UDP multicast load balancing and net.tcp load balancing. You should always try UDP multicasting first, because the configuration is far easier. If you discover (to your horror) that UPD MC is not an option, you’ll have to bite the bullet, have a strong drink, and go the net.tcp route. Here’s a picture of me after I discovered that UDP multicasting wasn’t an option in our latest project.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-HQ5cMMN71yA/UVn8jaQYC9I/AAAAAAAAJqE/l1zVBptOuxU/s1600/EW_Hopeless.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;168&quot; src=&quot;http://3.bp.blogspot.com/-HQ5cMMN71yA/UVn8jaQYC9I/AAAAAAAAJqE/l1zVBptOuxU/s320/EW_Hopeless.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Disclaimer: this individual&amp;nbsp;isn&#39;t&amp;nbsp;actually me, many of my fellow colleagues would never speak to me again if I started doing .NET development on an iMac. No second mouse button, give me a break!&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;EPiServer load balancing revolves around the broadcast of events to each of the servers. The idea is that if someone publishes a change to any of the pages on one server, the other servers must be told of this change and flush their cache (for the page that has changed). If you don’t have load balancing setup correctly, the other servers will continue to use the old, cached version of the page.&lt;br /&gt;&lt;br /&gt;The key difference between UDP MC and using net.tcp is that UPD MC broadcasts events to all the servers listing a single multicast IP address and port. Because it’s a multicast IP address, all servers can receive the broadcast message.&lt;br /&gt;&lt;br /&gt;Typically what prevents you from using UDP MC event handling are stricter security rules. Some IT departments don’t like the idea of UDP MC broadcasts being sent out to many servers and prefer to keep things more locked down.&lt;br /&gt;&lt;br /&gt;So without further delay, let’s get started.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;EPiServer.config Configuration&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;The first thing you need to do is update your &lt;b&gt;episerver.config&lt;/b&gt; file so that each site has event handling turned on. There are two attributes that are required in the &lt;b&gt;&amp;lt;siteSettings&amp;gt;&lt;/b&gt; element. These attributes are &lt;b&gt;enableEvents &lt;/b&gt;and &lt;b&gt;enableRemoteEvents&lt;/b&gt;. Both of these should be set to &quot;&lt;b&gt;true&lt;/b&gt;&quot;. If you have an EPiServer enterprise environment, you must do this for each &lt;b&gt;&amp;lt;siteSettings&amp;gt;&lt;/b&gt; element for each &lt;b&gt;&amp;lt;site&amp;gt;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml;&quot;&gt;&amp;lt;sites&amp;gt;&lt;br /&gt;  &amp;lt;site siteId=&quot;MySite&quot; description=&quot;My Test Site&quot;&amp;gt;&lt;br /&gt;    &amp;lt;siteSettings ... more stuff ... enableEvents=&quot;true&quot; enableRemoteEvents=&quot;true&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/site&amp;gt;&lt;br /&gt;  &amp;lt;site siteId=&quot;MySite2&quot; description=&quot;My Test Site 2&quot;&amp;gt;&lt;br /&gt;    &amp;lt;siteSettings ... more stuff ... enableEvents=&quot;true&quot; enableRemoteEvents=&quot;true&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/site&amp;gt;&lt;br /&gt;        &lt;br /&gt;  ... more ...&lt;br /&gt; &lt;br /&gt;&amp;lt;/sites&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now comes the fun part. You need to determine which servers will be event &quot;broadcasters&quot; and which servers will be event &quot;listeners&quot;. Please note that servers can be both a &quot;broadcaster&quot; and a &quot;listener&quot;.&lt;br /&gt;Servers that are &quot;broadcasters&quot; will be broadcasting events to other servers. These are typically the CMS server(s). If you have more than one server that CMS editors will be connecting to in order to publish changes you will have multiple &quot;broadcasters&quot;.&lt;br /&gt;&lt;br /&gt;Servers that are &quot;listeners&quot; will be receiving events from other servers. These are typically the public facing servers. Please note that if a server is not configured to be a &quot;listener&quot; it will never be alerted if changes to content are made on other servers.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Net.tcp General Configuration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;First you want to make sure that you have the appropriate configuration in &lt;b&gt;Web.config&lt;/b&gt; to support net.tcp binding. Make sure that you have the &lt;b&gt;&amp;lt;netTcpBinding&amp;gt;&lt;/b&gt; element in the &lt;b&gt;&amp;lt;system.serviceModel&amp;gt;&amp;lt;bindings&amp;gt;&lt;/b&gt;&amp;nbsp;element in your Web.config.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml;&quot;&gt;&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;client&amp;gt;&lt;br /&gt;      ... more stuff ...&lt;br /&gt;    &amp;lt;/client&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;bindings&amp;gt;&lt;br /&gt;&lt;br /&gt;        &amp;lt;customBinding&amp;gt;&lt;br /&gt;          &amp;lt;binding name=&quot;RemoteEventsBinding&quot;&amp;gt;&lt;br /&gt;            &amp;lt;binaryMessageEncoding /&amp;gt;&lt;br /&gt;            &amp;lt;udpTransport multicast=&quot;True&quot; /&amp;gt;&lt;br /&gt;          &amp;lt;/binding&amp;gt;&lt;br /&gt;        &amp;lt;/customBinding&amp;gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;netTcpBinding&amp;gt;&lt;br /&gt;          &amp;lt;binding name=&quot;RemoteEventsBinding&quot;&amp;gt;&lt;br /&gt;            &amp;lt;security mode=&quot;None&quot; /&amp;gt;&lt;br /&gt;          &amp;lt;/binding&amp;gt;&lt;br /&gt;        &amp;lt;/netTcpBinding&amp;gt;&lt;br /&gt; &lt;br /&gt;    &amp;lt;/bindings&amp;gt;&lt;br /&gt;    &lt;br /&gt;    ... more stuff ...&lt;br /&gt;&lt;br /&gt;&amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Please note that the &lt;b&gt;&amp;lt;customBinding&amp;gt;&lt;/b&gt; element would be used for UDP MC events. It’s safe to leave this in place as a reference.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Configuring &quot;Broadcasters&quot;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;The hardest part about configuring &quot;broadcasters&quot; is understanding that &quot;broadcasters&quot; actually act as clients to the listeners. This means that the &quot;broadcasters&quot; call the remote event service on each &quot;listener&quot; server.&lt;br /&gt;&lt;br /&gt;To property configure the &quot;broadcasters&quot;, update the &lt;b&gt;&amp;lt;client&amp;gt;&lt;/b&gt; element in the &lt;b&gt;&amp;lt;system.serviceModel&amp;gt;&lt;/b&gt; element in &lt;b&gt;Web.config&lt;/b&gt;. You need to create a separate client endpoint for &lt;b&gt;&lt;u&gt;each&lt;/u&gt; &lt;/b&gt;enterprise site for &lt;b&gt;&lt;u&gt;each&lt;/u&gt; &lt;/b&gt;listener server you want to broadcast to. Each client endpoint must have a specific syntax for the name attribute: &lt;b&gt;name=&quot;{siteId}-{IP address of server}&quot;&lt;/b&gt;. Please note that the &lt;b&gt;siteId &lt;/b&gt;needs to match the &lt;b&gt;siteId &lt;/b&gt;attribute in &lt;b&gt;episerver.config&lt;/b&gt;. Also within each collection of client endpoints for a specific target &quot;listener&quot;, the endpoints must have unique ports.&lt;br /&gt;&lt;br /&gt;So if you have a single &quot;broadcaster&quot; acting as the client to two &quot;listeners&quot; on an EPiServer enterprise environment with two sites you will have four client endpoints.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Broadcaster #1 to Listener #1 (Site #1) port 13000&lt;/li&gt;&lt;li&gt;Broadcaster #1 to Listener #1 (Site #2) port 13001&lt;/li&gt;&lt;li&gt;Broadcaster #1 to Listener #2 (Site #1) port 13000&lt;/li&gt;&lt;li&gt;Broadcaster #1 to Listener #2 (Site #2) port 13001&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Remember that each client endpoint (within a collection of client endpoints for a specific target &quot;listener&quot; server) will have its own port number. Typically you start at 13000 and work your way up.&lt;br /&gt;&lt;br /&gt;The example below should help illustrate.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml;&quot;&gt;&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;  &amp;lt;client&amp;gt;&lt;br /&gt;&amp;lt;!--robstr: no longer using UDP multicast event handling, switched to net.tcp--&amp;gt;&lt;br /&gt;&amp;lt;!--this was previously used for UDP MC event handing&lt;br /&gt;&amp;lt;endpoint&lt;br /&gt;name=&quot;RemoteEventServiceClientEndPoint&quot; &lt;br /&gt;address=&quot;soap.udp://224.0.0.1:5000/RemoteEventService&quot; &lt;br /&gt;binding=&quot;customBinding&quot; bindingConfiguration=&quot;RemoteEventsBinding&quot; &lt;br /&gt;contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot;/&amp;gt;&lt;br /&gt;--&amp;gt;&lt;br /&gt;    &amp;lt;endpoint&lt;br /&gt;        name=&quot;MySite-192.168.7.130&quot;&lt;br /&gt;        address=&quot;net.tcp://192.168.7.130:13000/RemoteEventService&quot;&lt;br /&gt;        bindingConfiguration=&quot;RemoteEventsBinding&quot;&lt;br /&gt;        contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot;&lt;br /&gt;        binding=&quot;netTcpBinding&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;endpoint&lt;br /&gt;        name=&quot;MySite2-192.168.7.130&quot;&lt;br /&gt;        address=&quot;net.tcp://192.168.7.130:13001/RemoteEventService&quot;&lt;br /&gt;        bindingConfiguration=&quot;RemoteEventsBinding&quot;&lt;br /&gt;        contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot;&lt;br /&gt;        binding=&quot;netTcpBinding&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;endpoint&lt;br /&gt;        name=&quot;MySite-192.168.7.131&quot;&lt;br /&gt;        address=&quot;net.tcp://192.168.7.131:13000/RemoteEventService&quot;&lt;br /&gt;        bindingConfiguration=&quot;RemoteEventsBinding&quot;&lt;br /&gt;        contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot;&lt;br /&gt;        binding=&quot;netTcpBinding&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;endpoint&lt;br /&gt;        name=&quot;MySite2-192.168.7.131&quot;&lt;br /&gt;        address=&quot;net.tcp://192.168.7.131:13001/RemoteEventService&quot;&lt;br /&gt;        bindingConfiguration=&quot;RemoteEventsBinding&quot;&lt;br /&gt;        contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot;&lt;br /&gt;        binding=&quot;netTcpBinding&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/client&amp;gt;&lt;br /&gt;&amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Configuring &quot;Listeners&quot;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&quot;Listeners&quot; listen for incoming event broadcasts from the &quot;broadcasters&quot;. A listener simply has to have a service endpoint available for the &quot;broadcasters&quot; to connect to. This is done by configuring the appropriate &lt;b&gt;&amp;lt;service&amp;gt;&lt;/b&gt; elements in the &lt;b&gt;&amp;lt;system.webService&amp;gt;&amp;lt;services&amp;gt;&lt;/b&gt; element in &lt;b&gt;Web.config&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;In this case you need to make sure to have a separate service available for &lt;u&gt;&lt;b&gt;each&lt;/b&gt;&lt;/u&gt; EPiServer site (when using EPiServer enterprise). Each service endpoint must have its own port number and the &lt;b&gt;&amp;lt;service&amp;gt;&lt;/b&gt; element should have the following pattern syntax for the &lt;b&gt;name &lt;/b&gt;attribute: &lt;b&gt;name=&quot;{siteId}/EPiServer.Events.Remote.EventReplication&quot;&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;In the example below, we have two service endpoints (one for each of the two sites). Each &quot;listener&quot; server would have this same configuration (with the exception of the IP addresses).&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: xml;&quot;&gt;&amp;lt;system.serviceModel&amp;gt;&lt;br /&gt;&lt;br /&gt;... more stuff ...&lt;br /&gt;&lt;br /&gt;&amp;lt;!--robstr: we are using net.tcp for load balancing, not UPD mulicast.  The public server configuration must listen, so it has services.--&amp;gt;&lt;br /&gt;  &amp;lt;services&amp;gt;&lt;br /&gt; &lt;br /&gt;&amp;lt;!-- left over from UDP MC event handling &amp;lt;service name=&quot;EPiServer.Events.Remote.EventReplication&quot; xdt:Locator=&quot;Match(name)&quot;&amp;gt;&lt;br /&gt;&amp;lt;endpoint name=&quot;RemoteEventServiceEndPoint&quot; contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot; binding=&quot;customBinding&quot;&lt;br /&gt;bindingConfiguration=&quot;RemoteEventsBinding&quot; address=&quot;soap.udp://224.89.89.89:5000/RemoteEventService&quot; xdt:Transform=&quot;Insert&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/service&amp;gt;&lt;br /&gt;--&amp;gt;&lt;br /&gt; &lt;br /&gt;    &amp;lt;service name=&quot;MySite/EPiServer.Events.Remote.EventReplication&quot;&amp;gt;&lt;br /&gt;      &amp;lt;endpoint&lt;br /&gt;      name=&quot;RemoteEventServiceEndPoint&quot;&lt;br /&gt;      contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot;&lt;br /&gt;      bindingConfiguration=&quot;RemoteEventsBinding&quot;&lt;br /&gt;      address=&quot;net.tcp://192.168.7.130:13000/RemoteEventService&quot;&lt;br /&gt;      binding=&quot;netTcpBinding&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/service&amp;gt;&lt;br /&gt;            &lt;br /&gt;    &amp;lt;service name=&quot;MySite2/EPiServer.Events.Remote.EventReplication&quot; &amp;gt;&lt;br /&gt;      &amp;lt;endpoint&lt;br /&gt;      name=&quot;RemoteEventServiceEndPoint&quot;&lt;br /&gt;      contract=&quot;EPiServer.Events.ServiceModel.IEventReplication&quot;&lt;br /&gt;      bindingConfiguration=&quot;RemoteEventsBinding&quot;&lt;br /&gt;      address=&quot;net.tcp://192.168.7.130:13001/RemoteEventService&quot;&lt;br /&gt;      binding=&quot;netTcpBinding&quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/service&amp;gt;&lt;br /&gt;  &amp;lt;/services&amp;gt;&lt;br /&gt;&amp;lt;/system.serviceModel&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That about does it. To test your configuration log onto a &quot;broadcaster&quot; server and do a page change/publish. You should see this change reflected in all the &quot;listener&quot; servers.&lt;br /&gt;&lt;br /&gt;Stay tuned for my next blog post of disabling CMS edit/admin mode from the public facing IIS servers.&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;Robert</summary>
    </entry>    <entry>
        <title>Custom settings for link properties in EPiServer CMS</title>
        <link href="http://shahinalborz.se/?p=604" />
        <id>http://shahinalborz.se/?p=604</id>
        <updated>2013-04-01T14:16:00.0000000Z</updated>
        <summary type="html">Even though a solution for this is already out there, albeit somewhat incoherent, way too many EPiServer websites lack the ability to limit the selection of pages editors may choose from when selecting a link in Edit mode. Editors cost money, and we need to keep them efficient and happy; that is in fact one [...]</summary>
    </entry>    <entry>
        <title>EPiServer custom property: Multiple Category checkbox list from specific sub category</title>
        <link href="http://shahinalborz.se/?p=505" />
        <id>http://shahinalborz.se/?p=505</id>
        <updated>2013-04-01T13:29:59.0000000Z</updated>
        <summary type="html">Sometimes editors have to select multiple categories from a long list, including other category nodes which might not be relevant for that page. This is a custom property which you can configure to only list categories from a certain category parent. The editors can then select multiple categories directly from a list of checkboxes. Configure [...]</summary>
    </entry>    <entry>
        <title>Dependencies and versioning for EPiServer add-ons</title>
        <link href="http://dmytroduk.com/techblog/dependencies-and-versioning-for-episerver-add-ons" />
        <id>http://dmytroduk.com/techblog/dependencies-and-versioning-for-episerver-add-ons</id>
        <updated>2013-03-28T18:17:00.0000000Z</updated>
        <summary type="html">&lt;p&gt;One of the most challenging problems that the Add-on system should solve is handling a lot of dependencies between different products.&lt;/p&gt;
&lt;p&gt;Site owners want to be sure that installed add-ons are compatible with the current environment. Add-on authors (developers, partners and EPiServer) want to release new product versions and make the upgrade easy for customers.&lt;/p&gt;
&lt;p&gt;This blog post describes how the EPiServer Add-on system handles dependencies and prerequisites and provides general rules and recommendations to consider when defining dependencies and versions for add-ons.&lt;/p&gt;
&lt;h2&gt;Problem: Dependency hell&lt;/h2&gt;
&lt;p&gt;The following quote is a great description of the problem:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In systems with many dependencies, releasing new package versions can quickly become a nightmare. If the dependency specifications are too tight, you are in danger of version lock (the inability to upgrade a package without having to release new versions of every dependent package). If dependencies are specified too loosely, you will inevitably be bitten by version promiscuity (assuming compatibility with more future versions than is reasonable). Dependency hell is where you are when version lock and/or version promiscuity prevent you from easily and safely moving your project forward.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p align=&quot;right&quot;&gt;&lt;a href=&quot;http://semver.org&quot;&gt;http://semver.org&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Solution: Semantic versioning&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://semver.org&quot;&gt;Semantic versioning&lt;/a&gt; is a set of rules to follow when defining version numbers for your component (public API, package, plugin, module, add-on, etc). It was suggested by &lt;a href=&quot;http://tom.preston-werner.com&quot;&gt;Tom Preston-Werner&lt;/a&gt;. Please have a look at &lt;a href=&quot;http://semver.org&quot;&gt;official SemVer website&lt;/a&gt; for details.&lt;/p&gt;
&lt;p&gt;The general idea is that a version has three parts, &lt;strong&gt;Major.Minor.Patch&lt;/strong&gt;, and each part indicates backward compatibility:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Major&lt;/strong&gt;: breaking changes. Increasing Major part means that this version has breaking changes and it is not backwards compatible.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Minor&lt;/strong&gt;: new features. Increasing Minor part means that this versions contains new functionality but it is still backwards compatible.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Patch&lt;/strong&gt;: bug fixes. Increasing this Patch part means that this version contains bug fixes and is backwards compatible.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A suffix appended to the Patch part and separated by dash symbol indicates prerelease version. Prerelease versions are sorted alphabetically and are always lower than release version with the same Major.Minor.Patch numbers.&lt;/p&gt;
&lt;p&gt;Examples:&lt;/p&gt;
&lt;p&gt;Module 2.0.0 introduces breaking changes and is not compatible with Module 1.7.0.&lt;/p&gt;
&lt;p&gt;Module 1.7.0 is backwards compatible with Module 1.1.3, meaning that other component which depends on Module 1.1.3 should work fine with newer version 1.7.0.&lt;/p&gt;
&lt;p&gt;There is no functional differences between Module 1.1.3 and Module 1.1.0 and these components are compatible, however 1.1.3 fixes some bugs.&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;&quot; style=&quot;background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;&quot; border=&quot;0&quot; alt=&quot;Semantic versioning&quot; src=&quot;http://dmytroduk.com/Media/Default/Windows-Live-Writer/Dependencies-and-Versioning-for-EPiServe_10764/SemVerEvolution_3.png&quot; width=&quot;618&quot; height=&quot;196&quot; /&gt;&lt;/p&gt;
&lt;p&gt;NuGet supports package versioning according to the Semantic Versioning specification. In general the Add-on system follows NuGet guidelines and patterns.&lt;/p&gt;
&lt;h2&gt;Defining the add-on version&lt;/h2&gt;
&lt;h3&gt;Recommendations when defining the add-on version&lt;/h3&gt;
&lt;h4&gt;DO:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Use semantic versioning conventions when defining the version. Make sure that the Major part is increased if the new version introduces breaking changes. Increase the Minor part if the new add-on version brings new functionality but possible dependents should still work fine with it. Increase only the Patch part when the new version contains minor improvements and bug fixes.&lt;/li&gt;
&lt;li&gt;Use a combination of &lt;code&gt;AssemblyInformationalVersionAttribute&lt;/code&gt; and &lt;code&gt;AssemblyVersionAttribute&lt;/code&gt; when creating an add-on package from a project.&lt;/li&gt;
&lt;li&gt;Increase the Major version number when your add-on is rebuilt and it introduces breaking changes, even if it does not provide any new functionality or bug fixes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;DO NOT:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Avoid increasing the Major version number just because it sounds great or because sales guys ask you.&lt;/li&gt;
&lt;li&gt;Do not increase the Major version number depending on your dependency versions. New (Major) version of your add-on should reflect (breaking) changes in your add-on.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The add-on version can be defined in package / metadata / version node in &lt;a href=&quot;http://docs.nuget.org/docs/reference/nuspec-reference&quot;&gt;.nuspec file&lt;/a&gt;:&lt;/p&gt;
&lt;pre class=&quot;brush: xml; gutter: false; toolbar: false; highlight: [5];&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;package xmlns=&quot;http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd&quot;&amp;gt;
  &amp;lt;metadata&amp;gt;
    &amp;lt;id&amp;gt;Alloy.Sample&amp;lt;/id&amp;gt;
    &amp;lt;version&amp;gt;1.2.3&amp;lt;/version&amp;gt;
    &amp;lt;authors&amp;gt;Alloy&amp;lt;/authors&amp;gt;
    &amp;lt;description&amp;gt;Sample add-on.&amp;lt;/description&amp;gt;
  &amp;lt;/metadata&amp;gt;
&amp;lt;/package&amp;gt;
&lt;/pre&gt;
&lt;p&gt;You can use special placeholders in .nuspec file if &lt;a href=&quot;http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#From_a_project&quot;&gt;package is created from a project&lt;/a&gt;:&lt;/p&gt;
&lt;pre class=&quot;brush: xml; gutter: false; toolbar: false; highlight: [5];&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;package xmlns=&quot;http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd&quot;&amp;gt;
  &amp;lt;metadata&amp;gt;
    &amp;lt;id&amp;gt;$id$&amp;lt;/id&amp;gt;
    &amp;lt;version&amp;gt;$version$&amp;lt;/version&amp;gt;
    &amp;lt;authors&amp;gt;$author$&amp;lt;/authors&amp;gt;
    &amp;lt;description&amp;gt;$description$&amp;lt;/description&amp;gt;
  &amp;lt;/metadata&amp;gt;
&amp;lt;/package&amp;gt;
&lt;/pre&gt;
&lt;p&gt;In this case add-on version should be set using &lt;code&gt;AssemblyInformationalVersionAttribute&lt;/code&gt; or &lt;code&gt;AssemblyVersionAttribute&lt;/code&gt;, usually in AssemblyInfo.cs file:&lt;/p&gt;
&lt;pre class=&quot;brush: csharp; gutter: false; toolbar: false;&quot;&gt;[assembly: AssemblyVersion(&quot;1.2.3.0&quot;)]
[assembly: AssemblyInformationalVersion(&quot;1.2.3&quot;)]
&lt;/pre&gt;
&lt;p&gt;Using &lt;code&gt;AssemblyInformationalVersionAttribute&lt;/code&gt; allows to set semantic version in form of Major.Minor.Patch, in example above &quot;1.2.3&quot;. These 3 numbers will be set in the .nuspec file and used in the package file name: Alloy.Sample.1.2.3.nupkg.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;AssemblyVersionAttribute&lt;/code&gt; value is used as an add-on version if &lt;code&gt;AssemblyInformationalVersionAttribute&lt;/code&gt; is not found. Please note that in this case you will get 4 numbers in the version and file name (Alloy.Sample.1.2.3.0.nupkg), even if you specify 3 numbers in the attribute value. I would recommend using 0 as the fourth number in the &lt;code&gt;AssemblyVersionAttribute&lt;/code&gt; value as in example above since it does not fit the SemVer pattern. You can use &lt;code&gt;AssemblyFileVersionAttribute&lt;/code&gt; if you distinguish different revisions as file versions.&lt;/p&gt;
&lt;h3&gt;Defining prerelease add-on version&lt;/h3&gt;
&lt;p&gt;Prerelease add-on versions can be defined directly in the .nuspec file or using the &lt;code&gt;AssemblyInformationalVersionAttribute&lt;/code&gt; when the package is created from a project:&lt;/p&gt;
&lt;pre class=&quot;brush: csharp; gutter: false; toolbar: false;&quot;&gt;[assembly: AssemblyInformationalVersion(&quot;1.2.3-beta&quot;)]
&lt;/pre&gt;
&lt;h3&gt;Enabling prerelease versions in Add-On Store&lt;/h3&gt;
&lt;p&gt;By default prerelease add-on versions cannot be installed and they are not visible in Add-On Store. Set the &lt;code&gt;allowPrereleaseVersions&lt;/code&gt; attribute of &lt;code&gt;episerver.packaging&lt;/code&gt; element to &lt;code&gt;&quot;true&quot;&lt;/code&gt; to enable installing prerelease package versions on the site:&lt;/p&gt;
&lt;pre class=&quot;brush: xml; gutter: false; toolbar: false; highlight: [3];&quot;&gt;&amp;lt;configuration&amp;gt;
  &amp;lt;!-- ... ommited configuration ...--&amp;gt;
  &amp;lt;episerver.packaging allowPrereleaseVersions=&quot;true&quot; ... &amp;gt;
    &amp;lt;packageRepositories&amp;gt; ... &amp;lt;/packageRepositories&amp;gt;
  &amp;lt;/episerver.packaging&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre&gt;
&lt;h2&gt;Defining the add-on dependencies&lt;/h2&gt;
&lt;p&gt;An add-on has a dependency when it relies on some other module or component that needs to be deployed or installed on the website.&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;&quot; style=&quot;background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;&quot; border=&quot;0&quot; alt=&quot;Dependencies&quot; src=&quot;http://dmytroduk.com/Media/Default/Windows-Live-Writer/Dependencies-and-Versioning-for-EPiServe_10764/Dependencies_3.png&quot; width=&quot;640&quot; height=&quot;335&quot; /&gt;&lt;/p&gt;
&lt;p align=&quot;right&quot;&gt;&lt;span color=&quot;#a5a5a5&quot; size=&quot;1&quot; style=&quot;color: #a5a5a5; font-size: xx-small;&quot;&gt;&lt;sub&gt;&lt;span color=&quot;#a5a5a5&quot; size=&quot;1&quot; style=&quot;color: #a5a5a5; font-size: xx-small;&quot;&gt;Photo: http://www.caryballetconservatory.com&lt;/span&gt;&lt;/sub&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Before installing any add-on the system tries to find all dependencies and dependents and check if all components are compatible.&lt;/p&gt;
&lt;p&gt;Given that component functionality usually differs from version to version and that new major versions usually contain breaking changes, information about dependency usually contains the component identifier and the lowest compatible version number or a version range.&lt;/p&gt;
&lt;p&gt;Add-on dependencies should be defined in the .nuspec file as described in the &lt;a href=&quot;http://docs.nuget.org/docs/reference/nuspec-reference#Specifying_Dependencies&quot;&gt;NuGet documentation&lt;/a&gt;. The NuGet &lt;a href=&quot;http://docs.nuget.org/docs/reference/Versioning&quot;&gt;Versioning article&lt;/a&gt; describes the general idea of specifying dependency version ranges.&lt;/p&gt;
&lt;p&gt;Try to minimize the number of dependencies and avoid dependencies on third-party components.&lt;/p&gt;
&lt;p&gt;The main guideline when defining add-on dependencies is to always set the lowest compatible dependency version. In addition you may want to define version range to set the maximum compatible version if your add-on functionality likely won&amp;rsquo;t be compatible with next major version of the dependency.&lt;/p&gt;
&lt;h3&gt;Dependencies on other add-ons&lt;/h3&gt;
&lt;p&gt;An add-on may rely on another add-on. When this add-on is being installed to the website, its dependency is installed automatically if possible.&lt;/p&gt;
&lt;p&gt;For example: add-on A depends on add-on B. Add-on B relies on add-on C. When the user installs add-on A, the system will also install add-ons B and C.&lt;/p&gt;
&lt;p&gt;&lt;img title=&quot;&quot; style=&quot;background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border-width: 0px;&quot; border=&quot;0&quot; alt=&quot;A - B - C dependencies&quot; src=&quot;http://dmytroduk.com/Media/Default/Windows-Live-Writer/Dependencies-and-Versioning-for-EPiServe_10764/AbcDependencies_5.png&quot; width=&quot;314&quot; height=&quot;167&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Use the package ID of dependency add-on as the dependency identifier and specify the lowest compatible version or version range.&lt;/p&gt;
&lt;p&gt;Example: you have developed a component to extend the Edit UI in and work with EPiServer Commerce data. The component uses some new features released in Edit UI 2.0 and is not compatible with the first version. The Edit UI is also an add-on and its package ID is &amp;ldquo;CMS&amp;rdquo; (I agree, not the ideal name for this package. We use this ID for backwards compatibility because in EPiServer 6 we had a protected Shell module &quot;CMS&quot;).&lt;/p&gt;
&lt;pre class=&quot;brush: xml; gutter: false; toolbar: false; highlight: [6];&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;package xmlns=&quot;http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd&quot;&amp;gt;
  &amp;lt;metadata&amp;gt;
    ...  
    &amp;lt;dependencies&amp;gt;
      &amp;lt;dependency id=&quot;CMS&quot; version=&quot;2.0&quot; /&amp;gt;
    &amp;lt;/dependencies&amp;gt;
  &amp;lt;/metadata&amp;gt;
&amp;lt;/package&amp;gt;
&lt;/pre&gt;
&lt;h3&gt;Prerequisites&lt;/h3&gt;
&lt;p&gt;Prerequisites are used to define required products and ensure platform compatibility.&lt;/p&gt;
&lt;p&gt;A prerequisite is a dependency that is not available as an add-on and cannot be installed by the Add-on system. Prerequisites should be deployed on the website before installing the dependent add-on.&lt;/p&gt;
&lt;p&gt;All assemblies loaded in the application domain are listed as virtual packages. It allows you to define prerequisites in the same way as dependencies on other add-ons. You just add a package dependency in .nuspec file and use the assembly name (without extension) as the dependency identifier and specify the assembly version or version range.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s define EPiServer 7 Commerce as a prerequisite for the sample add-on described in the previous section. As the dependency identifier use the name of the &amp;ldquo;main&amp;rdquo; prerequisite product assembly. EPiServer.Business.Commerce assembly should be a good choice in this case. Set the lowest compatible Commerce version, for example 7.0. Use a version range to define the highest compatible version of EPiServer Commerce.&lt;/p&gt;
&lt;pre class=&quot;brush: xml; gutter: false; toolbar: false; highlight: [7];&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;
&amp;lt;package xmlns=&quot;http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd&quot;&amp;gt;
  &amp;lt;metadata&amp;gt;
    ...  
    &amp;lt;dependencies&amp;gt;
      &amp;lt;dependency id=&quot;CMS&quot; version=&quot;2.0&quot; /&amp;gt;
      &amp;lt;dependency id=&quot;EPiServer.Business.Commerce&quot; version=&quot;[7.0,8.0)&quot; /&amp;gt;
    &amp;lt;/dependencies&amp;gt;
  &amp;lt;/metadata&amp;gt;
&amp;lt;/package&amp;gt;
&lt;/pre&gt;
&lt;p&gt;In this example version range defines all EPiServer Commerce versions 7.x.x as compatible but excludes