<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fredrik Haglund's blog &#187; EPiServer</title>
	<atom:link href="http://blog.fredrikhaglund.se/blog/tag/episerver/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fredrikhaglund.se</link>
	<description>Chatter about EPiServer, ASP.NET, CSS and Web Development.</description>
	<lastBuildDate>Tue, 28 Jun 2011 13:37:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to fix alphabetic sorting of pages in EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 09:14:20 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Collation]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[FilterSort]]></category>
		<category><![CDATA[FinishedLoadingChildren]]></category>
		<category><![CDATA[GetChildren]]></category>
		<category><![CDATA[PeerOrderRule]]></category>
		<category><![CDATA[Sort Order]]></category>
		<category><![CDATA[tblPageLanguage]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/</guid>
		<description><![CDATA[Update: Do not try to change collation order in the database! Use this approach instead to sort pages in the page tree in EPiServer CMS 5. I recently got the question how to fix the incorrect alphabetic sorting of child pages in EPiServer. It is usually Scandinavian users complaining that Å, Ä and Ö are sorted [...]]]></description>
			<content:encoded><![CDATA[<div><strong><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image2.png"><img style="margin: 0px 0px 0px 10px; display: inline; border-width: 0px;" title="image" src="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image_thumb2.png" border="0" alt="image" width="244" height="112" align="right" /></a>Update: <a href="http://blog.fredrikhaglund.se/blog/2010/10/11/fix-alphabetic-sorting-of-pages-in-episerver-cms-5/">Do not try to change collation order in the database! Use this approach instead to sort pages in the page tree in EPiServer CMS 5</a>.</strong></div>
<div>I recently got the question how to fix the incorrect alphabetic sorting of child pages in EPiServer. It is usually Scandinavian users complaining that Å, Ä and Ö are sorted together with A and O instead of being at the end of the list.</div>
<h3>Sort order: Alphabetical</h3>
<div>When you specify the sort order of child pages your selection is stored in the database (<em>tblPage.PeerOrderRule</em>) and is shared for all language branches.</div>
<div>When you use <em>GetChildren()</em> it calls a stored procedure called <em>netPageLinkList </em>that returns the children ordered differently depending on the selection. Sorting is done in the database.</div>
<h3><del>Easy Solution To Child Page Sort Order in EPiServer</del></h3>
<div>
<div><del></del></div>
<div><del></del></div>
<p><del></p>
<div>1) Easiest way to fix sorting is to change the Collation order of the Name column in the <em>tblPageLanguage</em> table.</div>
<p></del></p>
<div><del><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image3.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="image" src="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image_thumb3.png" border="0" alt="image" width="500" height="321" /></a></del></div>
<h3>different sort order depending on the current culture</h3>
<div>The easy solution only allows one common sort order for the entire database and that might not be good enough for multi lingual sites.</div>
<div>2) You can solve this for the whole site by hooking the event <em>DataFactory.FinishedLoadingChildren</em> and resorting the pages. Remember that this event is called every time you call <em>GetChildren()</em> and the result is not cached.</div>
<div>3) Another way is to solve it locally is to use the FilterSort class on you PageDataCollection or setting the SortOrder property on you PageList.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>EPiServer LicenseException: x.x.x.x is not a valid ip-address</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/09/11/episerver-licenseexception-xxxx-is-not-a-valid-ip-address/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/09/11/episerver-licenseexception-xxxx-is-not-a-valid-ip-address/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 13:20:58 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[LicenseException]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=242</guid>
		<description><![CDATA[I got a support question on this Exception today. First thought is that the ip-address was misstyped or the wrong license.config file was used but ipconfig /all and the IPRestiriction tag in license.config matched! How does EPiServer validate the ip-address? The code to check is quite simple. It is using the DNS service to lookup [...]]]></description>
			<content:encoded><![CDATA[<p>I got a support question on this Exception today. First thought is that the ip-address was misstyped or the wrong license.config file was used but ipconfig /all and the IPRestiriction tag in license.config matched!</p>
<h3>How does EPiServer validate the ip-address?</h3>
<p>The code to check is quite simple. It is using the DNS service to lookup the name of the computer and then lookup all ip-addresses for that computer name.</p>
<pre><code>foreach (IPAddress address in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
{
    if (!IPAddress.IsLoopback(address) &amp;&amp; this._ip.Equals(address))
    {
        this._isValid = true;
    }
}
</code></pre>
<h3>Troubleshooting License Exception  </h3>
<p>A quick test is to add a small debug.aspx file to find out what values are returned.</p>
<pre><code>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot;  %&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>
 &quot;&gt;
&lt;script runat=&quot;server&quot;&gt;

    protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (System.Net.IPAddress address in System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList)
        {
            ListBox1.Items.Add(address.ToString()+ &quot;-&quot; + System.Net.IPAddress.IsLoopback(address).ToString());
        }
    }
&lt;/script&gt;
&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>
 &quot; &gt;
&lt;head runat=&quot;server&quot;&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;h1&gt;Check IP-addresses&lt;/h1&gt;
    &lt;p&gt;Current host name: &lt;%= System.Net.Dns.GetHostName() %&gt;&lt;/p&gt;
    &lt;div&gt;
        &lt;asp:ListBox ID=&quot;ListBox1&quot; runat=&quot;server&quot;&gt;&lt;/asp:ListBox&gt;
        &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; onclick=&quot;Button1_Click&quot; Text=&quot;Test&quot; /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<h3>Resolution to LicenseException in this case</h3>
<p>Running the test aboved showed us that the IP-address returned was the loopback address 127.0.0.1 instead of the computers ip-address.</p>
<p>Since this setup is an enterprise site with a lot of diffrent host names pointing to diffrent start pages the local hosts-file (at C:\Windows\System32\drivers\etc\hosts) was edited and all known host names was added pointing to 127.0.0.1 to make it possible to test. One entry was accidentally added with the machine name and when we removed that line everything started to work!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/09/11/episerver-licenseexception-xxxx-is-not-a-valid-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move built-in property to another tab when editing</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/06/08/move-built-in-property-to-another-tab-when-editing/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/06/08/move-built-in-property-to-another-tab-when-editing/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 06:30:00 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[OwnerTab]]></category>
		<category><![CDATA[TabDefinition]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/06/08/move-built-in-property-to-another-tab-when-editing/</guid>
		<description><![CDATA[One of our customers required that we limited access to the Advanced Information tab in edit mode for normal editors. A reasonable requirement but how do you enable normal editors to adjust the sort order? The answer is to move these built-in properties to a new tab. Where to I hook my Event in EPiServer? [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2009/06/image.png"><img style="border-right-width: 0px; margin: 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://blog.fredrikhaglund.se/wp-content/uploads/2009/06/image-thumb.png" width="240" height="145" /></a> One of our customers required that we limited access to the Advanced Information tab in edit mode for normal editors. A reasonable requirement but how do you enable normal editors to adjust the sort order? </p>
<p>The answer is to move these built-in properties to a new tab.</p>
<h3>Where to I hook my Event in EPiServer?</h3>
<p>In latest releases of EPiServer CMS you are not allowed to access come parts of EPiServer to early. That is why I hook <em>FirstBeginRequest</em> event on EPiServer <em>InitializationModule</em> during <em>Application_Start</em> in <em>Global.asax</em>. You could also do this in <em>Init()</em> of an <em>HttpModule</em>.</p>
<p>All initialization is then done in that Event handler. We start by loading the target <em>TabDefinition</em> to get the <em>ID</em> then we hook <em>EditPanel.LoadedPage</em>. </p>
<p>EditPanel is the user class implementing EPiServers editor interface and LoadedPage is a static event that is fired every time the editor is shown. A perfect hook to tweak the editor! </p>
<h3>Source Code in Global.asax.cs to change tab for properties </h3>
<pre class="csharpcode"><span class="kwrd">protected</span> <span class="kwrd">void</span> Application_Start(Object sender, EventArgs e)
{
    InitializationModule.FirstBeginRequest += InitializationModule_FirstBeginRequest;
}

<span class="kwrd">void</span> InitializationModule_FirstBeginRequest(<span class="kwrd">object</span> sender, EventArgs e)
{
    CreateEventToMovePageOrderPropertyToCustomTab();
}

<span class="kwrd">private</span> <span class="kwrd">int</span> pageOrderTabID;

<span class="kwrd">private</span> <span class="kwrd">void</span> CreateEventToMovePageOrderPropertyToCustomTab()
{
    <span class="kwrd">string</span> pageOrderTabName = WebConfigurationManager.AppSettings[<span class="str">&quot;PageOrderTab&quot;</span>];
    var pageOrderTab = TabDefinition.Load(pageOrderTabName);
    <span class="kwrd">if</span> (pageOrderTab!=<span class="kwrd">null</span>)
    {
        pageOrderTabID = pageOrderTab.ID;
        EditPanel.LoadedPage += EditPanel_LoadedPage;
    }
}

<span class="kwrd">void</span> EditPanel_LoadedPage(EditPanel sender, LoadedPageEventArgs e)
{
    e.Page.Property[<span class="str">&quot;PageChildOrderRule&quot;</span>].OwnerTab = pageOrderTabID;
    e.Page.Property[<span class="str">&quot;PagePeerOrder&quot;</span>].OwnerTab = pageOrderTabID;
}</pre>
<h3>Settings in web.config</h3>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">configuration</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">appSettings</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">key</span><span class="kwrd">=&quot;PageOrderTab&quot;</span>
         <span class="attr">value</span><span class="kwrd">=&quot;Sidadministration&quot;</span><span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">appSettings</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">configuration</span><span class="kwrd">&gt;</span></pre>
<p>As usual, drop a comment if you think this is usefull! It is good for my blogging morale. <img src='http://blog.fredrikhaglund.se/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/06/08/move-built-in-property-to-another-tab-when-editing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Are you safe? Dangers of XSS&#8230;</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/06/03/cross-site-scripting-xss/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/06/03/cross-site-scripting-xss/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 07:55:34 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=210</guid>
		<description><![CDATA[If you allow the visitors of your site to contribute, for example with a simple comment this textbox, you take the risk that a malicious user inject evil code in a comment. This evil code is then executed in the browser by your sites&#8217; ordinary visitors. Scripts can steals passwords (maybe your own admin account), trick the [...]]]></description>
			<content:encoded><![CDATA[<p>If you allow the visitors of your site to contribute, for example with a simple comment this textbox, you take the risk that a malicious user inject evil code in a comment.</p>
<p>This evil code is then executed in the browser by your sites&#8217; ordinary visitors. Scripts can steals passwords (maybe your own admin account), trick the user to give up other senestive data or download malvare because they trust your site.</p>
<p>This kind of security vulnerability is reffered to as <a title="Wikipedia" href="http://en.wikipedia.org/wiki/Cross-site_scripting">XSS or Cross Site Scripting</a>. </p>
<h3>Always have input validation and filter you input</h3>
<p>A common aproach is to sanitize the data with a whitelisted or blacklisted characters to eliminate dangerous characters before storing or using the data. Another, is to always html encode data when it is rendered.  But it is harder than you think to get it right!</p>
<h3>70 ways to write the same character</h3>
<p>So you think you are smart and have a string replace or regular expression that removes &#8220;&lt;&#8221; from the user&#8217;s input on your website to be safe? I guess you need to test again&#8230; I had too!</p>
<p>Did you know that there is 70 diffrent ways to write the &#8220;&lt;&#8221; character in html? <a href="http://ha.ckers.org/xss.html" target="_blank">Read Robert Hansen&#8217;s good cheat sheet that lists known XSS attacks to get scared and take the problem serionsly</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/06/03/cross-site-scripting-xss/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sending an Email with an Edit Page-link</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/06/01/sending-an-email-with-an-edit-page-link/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/06/01/sending-an-email-with-an-edit-page-link/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 13:27:10 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/06/01/sending-an-email-with-an-edit-page-link/</guid>
		<description><![CDATA[Back from 2 healthy weeks of vacation on Iceland. Time to start blogging again! This time I want to share a simple but useful snippet of code that sends an email to an EPiServer editor with a link that opens the page for editing in EPiServer Edit Mode. How to create a go to Edit [...]]]></description>
			<content:encoded><![CDATA[<p>Back from 2 healthy weeks of vacation on Iceland. Time to start blogging again!</p>
<p><em>This time I want to share a simple but useful snippet of code that sends an email to an EPiServer editor with a link that opens the page for editing in EPiServer Edit Mode.</em></p>
<h3>How to create a go to Edit Mode link and mail it</h3>
<pre class="csharpcode"><span class="kwrd">string</span> baselink = UriSupport.AbsoluteUrlFromUIBySettings(<span class="str">&quot;edit/&quot;</span>);
<span class="kwrd">string</span> editlink = baselink + <span class="str">&quot;SwitchLanguage.aspx?language=&quot;</span> + page.LanguageBranch +
  <span class="str">&quot;&amp;epUrl=&quot;</span> + Server.UrlEncode(baselink + <span class="str">&quot;default.aspx?id=&quot;</span> + page.PageLink.ToString());
<span class="kwrd">string</span> pageurl = <span class="kwrd">string</span>.Format(<span class="str">&quot;&lt;a href=\&quot;{0}\&quot;&gt;Edit '{1}'&lt;/a&gt;&quot;</span>,
  editlink, page.PageName);

Utility.SendEmail(<span class="str">&quot;test@inexor.se&quot;</span>,

  EPiServerProfile.Current.EmailWithMembershipFallback,
  <span class="kwrd">string</span>.Format(<span class="str">&quot;[Moderate] {0}&quot;</span>, message),
  <span class="kwrd">string</span>.Format(
  <span class="str">@&quot;&lt;html&gt;&lt;body&gt;&lt;h1&gt;{0}&lt;/h1&gt;&lt;p&gt;The page&lt;b&gt;'{1}'&lt;/b&gt; must be review and published.&lt;/p&gt;&quot;</span> +
  <span class="str">@&quot;&lt;p&gt;Log in to EPiServer Edit Mode and use the following ID in the bottom left search box:&lt;br/&gt;&quot;</span> +
  <span class="str">@&quot;ID: &lt;b&gt;{2}&lt;/b&gt;&lt;/p&gt;&quot;</span> +
  <span class="str">@&quot;&lt;p&gt;Or click on the following link to login and review the page:&lt;br/&gt;{3}&lt;/p&gt;&quot;</span>,
  <span class="kwrd">new</span> <span class="kwrd">object</span>[] {message, page.PageName, page.PageLink.ID, pageurl}));</pre>
<h3>Works with unpublished versions of pages</h3>
<p>The code above expects a <em>PageData</em> object in the <em>page </em>variable. It handles WorkPageID if you send in a page that is just saved or retrieved through <em>PageVersion</em> class. </p>
<p>Read more about How to <a href="http://blog.fredrikhaglund.se/blog/2009/02/18/work-with-unpublished-pagedata-from-code/">work with Unpublished PageData from code</a> in a previous blog post!</p>
<p>As usual, please leave a comment if you find it useful or have something to add. It is good for my blogging morale. <img src='http://blog.fredrikhaglund.se/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/06/01/sending-an-email-with-an-edit-page-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>12 Maj: EPiServer-utvecklare i Stockholm träffas</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/04/24/12-maj-episerver-utvecklare-i-stockholm-trffas/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/04/24/12-maj-episerver-utvecklare-i-stockholm-trffas/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 16:02:02 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Användarförening]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[SIG]]></category>
		<category><![CDATA[User Group]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/04/24/12-maj-episerver-utvecklare-i-stockholm-trffas/</guid>
		<description><![CDATA[Jag och René Voigt vill hälsa alla intresserade välkomna till vårt första möte för EPiServerutvecklare i Stockholm. Vi har många intressanta saker att dela med oss med kring webbutveckling och EPiServer. Boka den 12 maj efter jobbet i din kalender. Inbjudan kommer med mejl på måndag med tid, plats och program till de som är [...]]]></description>
			<content:encoded><![CDATA[<p>Jag och René Voigt vill hälsa alla intresserade välkomna till vårt första möte för EPiServerutvecklare i Stockholm. Vi har många intressanta saker att dela med oss med kring webbutveckling och EPiServer.</p>
<p>Boka den <strong>12 maj efter jobbet</strong> i din kalender.</p>
<p>Inbjudan kommer med mejl på måndag med tid, plats och program till de som är medlemmar i <a href="http://www.meetup.com/EPiServer-Stockholm/" target="_blank">nätverket för EPiServer-utvecklare i Stockholm</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/04/24/12-maj-episerver-utvecklare-i-stockholm-trffas/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Användarförening för EPiServer utvecklare?</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/03/06/anvndarfrening-fr-episerver-utvecklare/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/03/06/anvndarfrening-fr-episerver-utvecklare/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 10:44:57 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Användarförening]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[SIG]]></category>
		<category><![CDATA[User Group]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/03/06/anvndarfrening-fr-episerver-utvecklare/</guid>
		<description><![CDATA[EPiServer växer så det knakar och vi som utvecklar med produkten blir fler och fler. Jag tror tiden är mogen att dra igång ett fristående nätverk för EPiServer utvecklare! Oavsett om man jobbar på ett litet eller stort företag finns det ett behov att dela erfarenheter och diskutera idéer kring webutveckling. Med ett fristående forum [...]]]></description>
			<content:encoded><![CDATA[<p>EPiServer växer så det knakar och vi som utvecklar med produkten blir fler och fler. Jag tror tiden är mogen att dra igång ett fristående nätverk för EPiServer utvecklare!</p>
<p>Oavsett om man jobbar på ett litet eller stort företag finns det ett behov att dela erfarenheter och diskutera idéer kring webutveckling.</p>
<p>Med ett fristående forum kan vi som deltar själva sätta agendan. Är vi flera kan vi också påverka EPiServer.</p>
<h3>Komma igång</h3>
<p>Låt oss starta enkelt med att bara träffas efter jobbet. <a href="http://www.meetup.com/EPiServer-Stockholm/" target="_blank">Anmäl ditt intresse att vara med på Meetup.</a> När vi blivit några stycken bestämmer vi en tid och plats att träffas!</p>
<p>Skriv en kommentar nedan eller på <a href="http://www.meetup.com/EPiServer-Stockholm/" target="_blank">Meetup-sajten</a>  om du har förslag på ämnen att diskutera!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/03/06/anvndarfrening-fr-episerver-utvecklare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EPiServer log: More configuration tips</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/02/03/episerver-log-more-configuration-tips/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/02/03/episerver-log-more-configuration-tips/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 16:53:48 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[log4net]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/02/03/episerver-log-more-configuration-tips/</guid>
		<description><![CDATA[Nicklas Israelsson shared in his blog how you can exclude some name spaces from the EPiServer log to reduce the noise while debugging. A very useful tip! I would like to share how I use logging to collect exceptions (and debug info) in production. How to setup production logging of Exceptions in EPiServer Paste the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://world.episerver.com/en/Blogs/Nicklas-Israelsson/">Nicklas Israelsson</a> shared in his blog <a href="http://world.episerver.com/en/Blogs/Nicklas-Israelsson/Dates/2009/2/EPiServer-log-Excluding-rows-from-selected-namespaces/">how you can exclude some name spaces from the EPiServer log to reduce the noise while debugging.</a> A very useful tip! I would like to share how I use logging to collect exceptions (and debug info) in production.</p>
<h3>How to setup production logging of Exceptions in EPiServer </h3>
<p>Paste the example below into the <em>EPiServerLog.config</em> file in the root of your EPiServer application. </p>
<pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0&quot;</span> <span class="attr">encoding</span><span class="kwrd">=&quot;utf-8&quot;</span>?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">log4net</span><span class="kwrd">&gt;</span>

  <span class="rem">&lt;!-- Appender with one new log file per day --&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">appender</span> <span class="attr">name</span><span class="kwrd">=&quot;fileLogAppender&quot;</span>
            <span class="attr">type</span><span class="kwrd">=&quot;log4net.Appender.RollingFileAppender&quot;</span> <span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">file</span> <span class="attr">value</span><span class="kwrd">=&quot;E:\EPiServerLog\www.example.com&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">encoding</span> <span class="attr">value</span><span class="kwrd">=&quot;utf-8&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">lockingModel</span> <span class="attr">type</span><span class="kwrd">=&quot;log4net.Appender.FileAppender+MinimalLock&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">appendToFile</span> <span class="attr">value</span><span class="kwrd">=&quot;true&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">rollingStyle</span> <span class="attr">value</span><span class="kwrd">=&quot;Date&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">staticLogFileName</span> <span class="attr">value</span><span class="kwrd">=&quot;false&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">datePattern</span> <span class="attr">value</span><span class="kwrd">=&quot;.yyyyMMdd.'log'&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">layout</span> <span class="attr">type</span><span class="kwrd">=&quot;log4net.Layout.PatternLayout&quot;</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">conversionPattern</span> <span class="attr">value</span><span class="kwrd">=&quot;%date %level [%thread] %type.%method - %message%n&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">layout</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">appender</span><span class="kwrd">&gt;</span>

  <span class="rem">&lt;!-- Log page publish to find editor related errors. --&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">logger</span> <span class="attr">name</span><span class="kwrd">=&quot;EPiServer.DataAccess.PageSaveDB&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">level</span> <span class="attr">value</span><span class="kwrd">=&quot;DEBUG&quot;</span> <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">logger</span><span class="kwrd">&gt;</span>

  <span class="rem">&lt;!-- Removing all rows coming from OptimisticCache --&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">logger</span> <span class="attr">name</span><span class="kwrd">=&quot;EPiServer.Core.OptimisticCache&quot;</span> <span class="attr">additivity</span><span class="kwrd">=&quot;false&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">level</span> <span class="attr">value</span><span class="kwrd">=&quot;Off&quot;</span><span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">appender-ref</span> <span class="attr">ref</span><span class="kwrd">=&quot;fileLogAppender&quot;</span> <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">logger</span><span class="kwrd">&gt;</span>  

  <span class="rem">&lt;!-- Send all errors to file. Level: Off, Fatal, Error, Warn, Info, Debug, All --&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">root</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">level</span> <span class="attr">value</span><span class="kwrd">=&quot;Error&quot;</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">appender-ref</span> <span class="attr">ref</span><span class="kwrd">=&quot;fileLogAppender&quot;</span> <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">root</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">log4net</span><span class="kwrd">&gt;</span></pre>
<p>TODO: You need to adjust the file-tag (<em>&quot;E:\EPiServerLog\&quot;</em>) to an existing folder where the account used by your asp.net application are allowed to write. Also notice that backslash must be escaped.</p>
<h4>lockingModel</h4>
<p>Notice that this differs from what is shipped in the default <em>EPiServerLog.config</em> file (that does not work <a href="http://en.wikipedia.org/wiki/AFAIK" target="_blank">AFAIK</a>).</p>
<h4>file, rollingStyle, staticLogFileName, datePattern</h4>
<p>These tags configures one file per day in the folder specified by the file-tag. I prefer to set <em>staticLogFileName</em> to false even if true might get some better performance.</p>
<h4>level</h4>
<p>Change level from <em>Error</em> to <em>Debug</em> or <em>All</em> if you need more data when you debug. Do remember to change it back to Error when you are done because your files grow fast and using reflection to find type and method steals some CPU-time, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/02/03/episerver-log-more-configuration-tips/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>EPiPattern: How to render valid xhtml (part 1/2)</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/12/08/epipattern-how-to-render-valid-xhtml-part-12/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/12/08/epipattern-how-to-render-valid-xhtml-part-12/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 12:39:50 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiPattern]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[HtmlEncode]]></category>
		<category><![CDATA[script injection]]></category>
		<category><![CDATA[ToWebString]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=182</guid>
		<description><![CDATA[How do you inject dynamic content into your web page? Following is a list of the most common methods I find when doing quality and code reviews with some comments and dangerous pitfalls. #1: Inline Expressions with Code Render Blocks Using inline expressions is a shortcut for calling the Write method. Example &#8211; DONT: &#60;h2&#62;&#60;%= [...]]]></description>
			<content:encoded><![CDATA[<p>How do you inject dynamic content into your web page? Following is a list of the most common methods I find when doing quality and code reviews with some comments and dangerous pitfalls.</p>
<h3>#1: Inline Expressions with Code Render Blocks</h3>
<p>Using <a href="http://msdn.microsoft.com/en-us/library/k6xeyd4z.aspx" target="_blank">inline expressions</a> is a shortcut for calling the <a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.write.aspx">Write</a> method.</p>
<h4>Example &#8211; DONT:</h4>
<pre class="csharpcode">&lt;h2&gt;&lt;%= CurrentPage.PageName %&gt;&lt;/h2&gt;
&lt;img src=<span class="str">"&lt;%= CurrentPage["</span>ImageUrl<span class="str">"] %&gt;"</span> alt=<span class="str">"&lt;%= CurrentPage["</span>MainIntro<span class="str">"] %&gt;"</span> /&gt;
&lt;div <span class="kwrd">class</span>=<span class="str">"mainarea"</span>&gt;

     &lt;%= CurrentPage[<span class="str">"MainBody"</span>] %&gt;
&lt;/div&gt;</pre>
<p>Since xhtml is just text, writing some more in-between existing static blocks is fast and simple. Probably the easiest way to inject dynamic content but it is also dangerous!</p>
<h4>Example – DO always use HtmlEncode:</h4>
<pre class="csharpcode">&lt;h2&gt;&lt;%= HttpUtility.HtmlEncode(CurrentPage.PageName) %&gt;&lt;/h2&gt;</pre>
<p>What happens if our PageName property contains a &#8220;&lt;&#8221; or &#8220;&amp;&#8221; character in the example above? Your page will not validate and you risk that it breaks down. It can also be exposed to <a title="How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings" href="http://msdn.microsoft.com/en-us/library/a2a4yykt.aspx" target="_blank">script injection</a> if the content is user generated.</p>
<p>To be on the safe side you should always call <em><a href="http://msdn.microsoft.com/en-us/library/73z22y6h.aspx" target="_blank">HttpUtility.HtmlEncode</a></em> on all strings that you inject with inline expressions.</p>
<h4>Example – DO always use a fallback for src-attributes</h4>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="&lt;%= CurrentPage["</span><span class="attr">ImageUrl</span><span class="kwrd">"] ?? "</span>/<span class="attr">Missing</span>.<span class="attr">png</span><span class="kwrd">" %&gt;"</span> <span class="kwrd">/&gt;</span></pre>
<p>If your ImageUrl property is empty you would get a img-tag with an empty src-attribute. This can lead to the page being rendered twice. <a title="How Firefox Handles Empty SRC tags" href="http://geekswithblogs.net/bcaraway/archive/2007/08/24/114945.aspx" target="_blank">FireFox interpret a null src-attribute a relative url and evaluate it using the page url as base returning the same url</a>.</p>
<h3>#2: With EPiServer:Property web control</h3>
<p>Using the EPiServer Property Web Controls instead of inline expressions has several benefits. It could be used for rendering the PageName and MainBody in the example above.</p>
<h4>Example – DO use EPiServer:Property web control</h4>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">h2</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PropertyName</span><span class="kwrd">="PageName"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">h2</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">CssClass</span><span class="kwrd">="mainarea"</span> <span class="attr">PropertyName</span><span class="kwrd">="MainBody"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;</span></pre>
<p>1) When rendering EPiServer&#8217;s <em>ToWebString()</em> is used. This does almost the same job as always calling <em>HtmlEncode</em> yourself.</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">virtual</span> <span class="kwrd">void</span> CreateDefaultControls()
{
    Label target = <span class="kwrd">new</span> Label();
    target.Text = PropertyData.ToWebString();
    CopyWebAttributes(target);
    Controls.Add(target);
}</pre>
<p>2) It enables the Simple Edit feature for the editors without any extra work. (If you do not know what &#8220;Simple Edit&#8221; is, you should read the <a title="EPiServer Documentation" href="http://world.episerver.com/en/Documentation/Categories/Documentation-Type/Manuals/" target="_blank">Editors Manual for EPiServer</a> before doing any more development.)</p>
<p>3) Different types have get different rendering automatically. Commonly used for <em>PageReferences</em> and Url&#8217;s that are rendered as a Hyperlink.</p>
<h4>Example – DO use EPiServer:Property for rendering links if possible</h4>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">EPiServer:PageList</span> <span class="attr">PageLinkProperty</span><span class="kwrd">="NewsArchivePage"</span> <span class="attr">MaxCount</span><span class="kwrd">="5"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">HeaderTemplate</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">h3</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PropertyName</span><span class="kwrd">="PageLink"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">h3</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">ul</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">HeaderTemplate</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PropertyName</span><span class="kwrd">="PageLink"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">FooterTemplate</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">ul</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">FooterTemplate</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">EPiServer:PageList</span><span class="kwrd">&gt;</span></pre>
<p>4) Use <em>PageLinkProperty</em> to follow a Page-property to another page and render a value. Takes care of all hassle and calls <em>GetPage()</em> and check for nulls for you.</p>
<h4>Example – DO use EPiServer:Property to render values from another page</h4>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">h3</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PageLinkProperty</span><span class="kwrd">="FeatureArticlePage"</span> <span class="attr">PropertyName</span><span class="kwrd">="PageLink"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">h3</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">div</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PageLinkProperty</span><span class="kwrd">="FeatureArticlePage"</span> <span class="attr">PropertyName</span><span class="kwrd">="MainIntro"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/12/08/epipattern-how-to-render-valid-xhtml-part-12/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>EPiServer Developers Wanted!</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/11/28/episerver-developers-wanted/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/11/28/episerver-developers-wanted/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 17:26:30 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[R2]]></category>
		<category><![CDATA[WebParts]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=177</guid>
		<description><![CDATA[We need more help. There has been a lot of things to do lately so I have not been able to blog as much as I want to but after release I have a lot of things to share with you all. Problems with WebParts in EPiServer CMS R2? Disappearing WebParts after upgrading a project to R2 [...]]]></description>
			<content:encoded><![CDATA[<p>We need more help. There has been a lot of things to do lately so I have not been able to blog as much as I want to but after release I have a lot of things to share with you all.</p>
<h3>Problems with WebParts in EPiServer CMS R2?</h3>
<p>Disappearing WebParts after upgrading a project to R2 is one of the fun things I have solved. It is related to serialization and reducing the number of assemblies by moving classes. I have a workaround if you need &#8211; just drop me a line&#8230;</p>
<h3>EPiServer Developer position open at INEXOR AB</h3>
<p><a title="DN Jobb - Drivna och erfarna EPiServer utvecklare sökes!" href="http://www.dn.se/DNet/jsp/polopoly.jsp?d=3127&amp;sa_id=329175988" target="_blank">My employer is looking for more EPiServer Developers to hire</a>. Even if the job ad is in Swedish, the working language is English so let us know if you are looking for a new job.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/11/28/episerver-developers-wanted/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installation of EPiServer components</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/07/22/installation-of-episerver-components/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/07/22/installation-of-episerver-components/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 08:50:20 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[activex]]></category>
		<category><![CDATA[EPiFileUpload]]></category>
		<category><![CDATA[EPiOfficeIntegration]]></category>
		<category><![CDATA[EpiserverOfficeAddin]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=154</guid>
		<description><![CDATA[In a larger organization it can be cumbersome to explain for the editors how to install the EPiServer ActiveX controls that provides you with some extended functionality. Security restrictions can also be a problem for ActiveX controls. So why bother? Well you will miss the following functionality: Spell checker, Microsoft Office Support A component that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image1.png" target="_blank"><img style="border-right: 0px; border-top: 0px; margin: 0px 10px 0px 0px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image-thumb1.png" border="0" alt="image" width="240" height="96" align="left" /></a>In a larger organization it can be cumbersome to explain for the editors how to install the EPiServer ActiveX controls that provides you with some extended functionality.</p>
<p>Security restrictions can also be a problem for ActiveX controls. So why bother? Well you will miss the following functionality:</p>
<ul>
<li><strong>Spell checker</strong>, Microsoft Office Support<br />
A component that enables the Editor to use Microsoft Word spell checker.</li>
<li><strong>Export to Excel</strong>, Microsoft Office Support<br />
A component that can export xForms data to Microsoft Excel.</li>
<li><strong>Advanced File Upload</strong><br />
A component that enables support for advanced file upload, for example drag-and-drop and multiple file upload.</li>
</ul>
<h3>Installation from your Browser</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image2.png" target="_blank"><img style="border-right: 0px; border-top: 0px; margin: 0px 0px 0px 10px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image-thumb2.png" border="0" alt="image" width="240" height="78" align="right" /></a>Click the Install-button on the Components tab on the Root/Welcome-page to install manually.</p>
<h3>Automate installation or workaround security problems</h3>
<p>Extract the DLL files inside the cab file to the client computer:<br />
\&lt;UI folder&gt;\activex\episerverclientcomponents.cab</p>
<p>Run the following command to install:<br />
regsvr32.exe EPiFileUpload.dll<br />
regsvr32.exe EPiOfficeIntegration.dll</p>
<p>Creating a script or small msi package that automates the installation is not very complicated and saves the editors the task to install this themselves. Remember that Advanced File Upload will also require a permission for function to be setup in admin mode.</p>
<h3>EPiServer Office Integration</h3>
<p>You can use <em>episerverofficeaddin.msi,</em> in the same folder, to get the Office Integration installed. I have had problem with upgrading so I always uninstall existing version first and then reinstall the latest version.</p>
<p>This tool can be very powerful if used right. Read the Tech Note on <a href="http://world.episerver.com/Items/Tech-Notes/EPiServer-CMS-SP2/Microsoft-Office-Integration/">Microsoft Office Integration </a>before you try to use it. It will require changes to <em>web.config</em>  before you can test it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/07/22/installation-of-episerver-components/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>EPiServer: &#8216;The virtual path could not be loaded&#8217; error when registering Web Parts in admin mode</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 14:29:14 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[Web Parts]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/</guid>
		<description><![CDATA[So you have created some web parts and they work fine on your test machine but when you want to register them on a test or production machine you only get a uninformative &#8216;The virtual path could not be loaded&#8217;. I guess you have already checked that the path is correct several times and that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image.png"><img style="border-right: 0px; border-top: 0px; margin: 0px 0px 5px 10px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/07/image-thumb.png" border="0" alt="image" width="240" height="130" align="right" /></a>So you have created some web parts and they work fine on your test machine but when you want to register them on a test or production machine you only get a uninformative &#8216;The virtual path could not be loaded&#8217;.</p>
<p>I guess you have already checked that the path is correct several times and that you have deployed all DLL&#8217;s and ASP.NET files. What is wrong?</p>
<h3>LoadControl() parses and compiles your markup</h3>
<p>A quick look with reflection reveals the LoadControl() is called to verify that the web part really exists. When you ask ASP.NET for a user control it will parse the ASCX-file, generate code and then compile it.</p>
<p>So there is a lot that can go wrong and all exceptions from this process is swallowed by the user interface and replaced with virtual path could not be loaded.</p>
<p>A good way to actually see the exception is to create a dummy aspx file and register all user controls and reference them from markup. When you try to view the aspx file any compilation error from the user controls will surface.</p>
<h3>Examine compile and pages tag in your web.config</h3>
<p>The most common reason markup works fine on one machine but not another is differences in web.config. Check the compilation and pages tag and compare them for differences between the machines.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/07/09/episerver-the-virtual-path-could-not-be-loaded-error-when-registering-web-parts-in-admin-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EPiPattern: DO &amp; DONT with EPiServer Properties</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/07/02/epipattern-do-dont-with-episerver-properties/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/07/02/epipattern-do-dont-with-episerver-properties/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 15:38:08 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Best practice]]></category>
		<category><![CDATA[EPiPattern]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/07/02/epipattern-do-dont-with-episerver-properties/</guid>
		<description><![CDATA[This might be obvious stuff for most seasoned EPiServer developers but I still think it is worth blogging about because I see these dangerous mistakes whenever I do a code review of an EPiServer project. Null values Remember that all EPiServer properties with an empty value never are stored in the database. If you access [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #545454;">This might be obvious stuff for most seasoned EPiServer developers but I still think it is worth blogging about because I see these dangerous mistakes whenever I do a code review of an EPiServer project.</span></p>
<h3>Null values</h3>
<p>Remember that all EPiServer properties with an empty value never are stored in the database. If you access it from code, it will always be <strong>null &#8211; not an empty string, 0 or false as you maybe expected</strong>.</p>
<p>Why null? It is by design and is very convenient if you want to check if something is not set by an editor or does not exist on this page. You just have to compare with null regardless of data type.</p>
<h4>Example &#8211; DO &amp; DONT</h4>
<p>This will throw <em>NullReferenceException</em> if value is empty or missing:<br />
sb.Append(CurrentPage["MyProperty"].ToString());</p>
<p>StringBuilder.Append accepts null objects so this is better:<br />
sb.Append(CurrentPage["MyProperty"]);</p>
<p>This will throw NullReferenceException if value is empty or missing:<br />
&lt;%= CurrentPage.Property["MyProperty"].Value.ToString()%&gt;</p>
<p>Markup will accept any type and convert to string so cast is not needed:<br />
&lt;%= CurrentPage ["MyProperty"] %&gt;</p>
<h4>Other examples with fallback</h4>
<p>If must have a string returned use as operator and ?? operator:<br />
string x = ["MyProperty"] as string ?? string.Empty;</p>
<p>And for Value Type it is written like this: (thanks Henrik)<br />
DateTime x = (DateTime)(CurrentPage[”MyProperty”] ?? DateTime.Now);<br />
int i = (int)(CurrentPage[”MyProperty”] ?? 0);</p>
<p>If you need a fallback in markup the?? Operator can be used:<br />
&lt;%= CurrentPage[“Heading”] ?? CurrentPage.PageName %&gt;</p>
<h3>Use Default indexer</h3>
<p>Remember that there is a default indexer on <em>PageData</em> that returns the value, too.</p>
<h4><strong>Example &#8211; DO &amp; DONT</strong></h4>
<p>This expression:<br />
&lt;%= CurrentPage.Property["MyProperty"].Value %&gt;</p>
<p>&#8230;is equivalent:<br />
&lt;%= CurrentPage["MyProperty"] %&gt;</p>
<h3>Common EPiServer Property Names</h3>
<p>It is very common that Page Types in EPiServer has the following properties.</p>
<h4>Heading (string)</h4>
<p>Used for the h1-tag of the page. If not defined the page is coded to fall back to the PageName. (See public templates for example implementation). This makes it possible to use PageName for a shorter text in menus and the meta title-tag and have a little longer text for the actual h1-header.</p>
<h4>MainIntro (string)</h4>
<p>This property is commonly used to describe a page in Teasers on other pages and in search results. It is usually also used to generate the meta description-tag which can affect the description external search engines like Google show.</p>
<p>There are functions in EPiServer that uses MainIntro – like <em>PreviewText()</em> method on <em>PageTemplateContainer</em> (type of Container object in EPiServer <em>PageList</em>, <em>PageTree</em>, etc). It implements a fallback if no MainIntro exists to strip MainBody of HTML and use first 400 characters.</p>
<h4>MainBody (string)</h4>
<p>Almost always used for the body text of an page in EPiServer.</p>
<h3>Read more</h3>
<p>Read more about <a href="http://blog.fredrikhaglund.se/blog/2007/11/03/properties-with-special-functionality-in-episerver/">Properties with Special Functionality in EPiServer</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/07/02/epipattern-do-dont-with-episerver-properties/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Enable debug logging for EPiServer Scheduler</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 18:02:54 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer.SchedulerSvc.exe.config]]></category>
		<category><![CDATA[Publish Delayed Page Versions]]></category>
		<category><![CDATA[Scheduled Jobs]]></category>
		<category><![CDATA[ScheduledPlugIn]]></category>
		<category><![CDATA[ScheduledPlugInAttribute]]></category>
		<category><![CDATA[Services]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/</guid>
		<description><![CDATA[If you have problems with the EPiServer Scheduler Service unexcitingly stopping you can also turn on debug logging to get more clues. Change EPiServer.SchedulerSvc.exe.config FILE You need to add the following to the service&#8217;s config-file to get detailed call stacks for exceptions that occur in you web application: &#60;system.runtime.remoting&#62;   &#60;customErrors mode="Off"/&#62; &#60;/system.runtime.remoting&#62; Update EPiServer.SchedulerSvc [...]]]></description>
			<content:encoded><![CDATA[<p>If you have problems with the EPiServer Scheduler Service unexcitingly stopping you can also turn on debug logging to get more clues.</p>
<h3>Change <em>EPiServer.SchedulerSvc.exe.config</em> FILE</h3>
<p>You need to add the following to the service&#8217;s config-file to get detailed call stacks for exceptions that occur in you web application:</p>
<p><code>&lt;system.runtime.remoting&gt;<br />
  &lt;customErrors mode="Off"/&gt;<br />
&lt;/system.runtime.remoting&gt;</code></p>
<h3>Update EPiServer.SchedulerSvc Registry</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image3.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb3.png" alt="image" height="126" style="margin: 0px 0px 0px 10px; border-width: 0px" /></a> Prepare a folder for the log file and make sure the account running the service has write access. I&#8217;m usually lazy and give everyone full access since this logging usually is not left on forever.</p>
<p>User RegEdit and change the ImagePath value for the EPiServer Scheduler Service to include a parameter with the log-filename.</p>
<p><code>HKLM\SYSTEM\CurrentControlSet\Services\EPiServer.SchedulerSvc<br />
ImagePath = C:\Program Files\EPiServer.Scheduler\EPiServer.SchedulerSvc.exe D:\Log\EPiServer.SchedulerSvc.log</code></p>
<p><strong>Be careful when you edit the Registry! </strong>I use to export the key to a file before I change anything so I can look at the original configuration.</p>
<p>See also: <a href="http://blog.fredrikhaglund.se/?p=127">Auto Restart of EPiServer Scheduler Service</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Auto Restart of EPiServer Scheduler Service</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 10:49:50 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Publish Delayed Page Versions]]></category>
		<category><![CDATA[Scheduled Jobs]]></category>
		<category><![CDATA[ScheduledPlugIn]]></category>
		<category><![CDATA[ScheduledPlugInAttribute]]></category>
		<category><![CDATA[Services]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/</guid>
		<description><![CDATA[There are several functions in a EPiServer Web Application that rely on the Services installed by EPiServer Manager. For example delayed publish of a new version of a page at a specific time, mirroring of pages between servers, archiving pages that has past the stopped publish date and removing old pages from the waste basket. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb.png" alt="image" height="172" style="margin: 0px 0px 0px 10px; border: 0px" /></a>There are several functions in a EPiServer Web Application that rely on the Services installed by EPiServer Manager. For example delayed publish of a new version of a page at a specific time, mirroring of pages between servers, archiving pages that has past the stopped publish date and removing old pages from the waste basket.</p>
<h3>Requirements for Scheduled Jobs in EPiServer</h3>
<p>Several things must be true for tasks to be executed:</p>
<ul>
<li><strong>The Service must be running<br />
</strong>The service is installed and updated by EPiServer manager but you may have to configure it and setup the in the computers Administrative Tool for Services.</li>
<li><strong>Each EPiServer Web must be allowed to use the Service</strong><br />
There is only one instance of the Service but there might be several Web Applications. Each has a setting that controls if they are allowed <strong><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image1.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb1.png" alt="image" height="172" style="margin: 10px 10px 0px 0px; border: 0px" /></a></strong>to connect to the service or not. This often misunderstood setting is displayed on the Capability page in EPiServer Manager.</li>
<li><strong>Each Job must be active and have a schedule</strong><br />
You must also for each Web Application go to admin mode and enable each Scheduled Job by checking Active and give it a schedule.</li>
</ul>
<h3>The EPiServer Scheduler Service does not appear to be active</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image2.png"><img border="0" align="left" width="240" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/04/image-thumb2.png" alt="image" height="196" style="margin: 0px 5px 0px 0px; border: 0px" /></a>If you have satisfied all requirements above and it suddenly stops working it can be an uncaught exception that halts your service.</p>
<p>My recommendation is always to configure the EPiServer Services to automatically restart if it should stop unexpectedly. This can be done from the Recovery Tab in the Properties for each Service.</p>
<h3>Update</h3>
<p>See also: <a rel="bookmark" href="http://blog.fredrikhaglund.se/blog/2008/04/03/enable-debug-logging-for-episerver-scheduler/"><font color="#006a80">Enable debug logging for EPiServer Scheduler</font></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/04/03/auto-restart-of-episerver-scheduler-service/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>EPiServer Export, Import or Mirror Troubles?</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 16:28:22 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Category]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Disassemble]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[Mirror]]></category>
		<category><![CDATA[PageTypeTransfer]]></category>
		<category><![CDATA[PropertyCategoryTransform]]></category>
		<category><![CDATA[TransformCategoryForExport]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/</guid>
		<description><![CDATA[I have been working a lot with migration and mirroring lately using EPiServer&#8217;s functions for export and import of data. My EPiServer Wish list Show call stack when exceptions halt export or import jobs Show PageID and Property related to errors and warnings during import and export This area of the product is still one [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working a lot with migration and mirroring lately using EPiServer&#8217;s functions for export and import of data.</p>
<div class="insert insertright">
<h3>My EPiServer Wish list</h3>
<ul>
<li>Show call stack when exceptions halt export or import jobs</li>
<li>Show PageID and Property related to errors and warnings during import and export</li>
</ul>
</div>
<p>This area of the product is still one of EPiServer weaker areas mainly because the error massages when something goes wrong does not contain enough information.</p>
<p>I want to share the last issue I run into today and also show how I did to find out what was wrong. We could not export and only got this lovely message:</p>
<p><code>The following errors have occurred: Exception: Object reference not set to an instance of an object.[]</code></p>
<p>As you can see not much to go on here&#8230;</p>
<h3>Strategy to resolve issues with EPiServer Export</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image15.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb3.png" alt="image" height="143" style="border-width: 0px" /></a> First thing you should do is to narrow down what is causing our problems and a call stack can often help. 1) We need to attach your debugger to the web server.</p>
<p>2) We must make sure it halts on thrown exceptions even if it outside our code. Open your options dialog and uncheck&#8221;Enable Just My Code&#8221;.</p>
<p><img border="0" align="left" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb4.png" alt="image" height="127" style="border-width: 0px" />With default settings the debugger will only break on uncaught exceptions.</p>
<p>3) We need the debugger to break when an exceptions are thrown regardless of they are handled by a try-catch statement.</p>
<p>This can be changed in your Exceptions dialog (Ctrl+Shift+E). You can either set it to catch all managed exceptions as I have in the screen shot or if you know what exception you are looking for you can halt on that one alone.</p>
<p>We are now ready to start the export again to trigger the error. If everything is correctly configured it will break on the exception and show you a call stack.</p>
<h3>Analyzing the call stack and Disassembling EPiServer</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image16.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb5.png" alt="image" height="176" style="border-width: 0px" /></a>With a call stack we have more clues to go on. In this case the two methods on top of the call stack gives us valuable clues.</p>
<p>Use <em>Lutz Roeder&#8217;s .NET Reflector</em> and click File&gt;Open to load all assemblies in your web applications bin-folder. Search for the class or method and Disassemble the two methods and get more clues.</p>
<p><code>PropertyCategoryTransform.TransformCategoryForExport<br />
PageTypeTransfer.Export</code></p>
<p>In this case it is probable that calling split on <em>categoriesAsIds</em> when <em>categoriesAsIds</em> is null is the culprit.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image17.png"><img border="0" align="left" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb6.png" alt="image" height="148" style="border: 0px" /></a> Looking at the calling method we can see that it is calling <em>TransformCategoryForExport</em> for <em>PageDefinitions</em> (a <em>PageDefinition</em> is another name for a property on a page type) if it as a Category. It does so to convert the Default Value for a Category property into a string with names instead of integer ids.</p>
<h3>Conclusion and workaround</h3>
<p>It is not possible to export a page type if you add a property of type Category selection (in EPiServer CMS 5 RC1 SP1 5.1.422.122). The reason is that default value is null and an easy workaround is to set the default value to &#8220;1&#8243; for each added Category property. The value &#8220;1&#8243; is the root category.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/28/episerver-export-import-or-mirror-troubles/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>EPiServer License violation!</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 23:59:03 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer.SchedulerSvc.exe.config]]></category>
		<category><![CDATA[License violation]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/</guid>
		<description><![CDATA[Have you been annoyed by the exception &#8220;License violation! License is already in use at another online site&#8221; when you switch from one web site to another on you developer machine? I have and the reason is of course that I use my developer license file in more than one place. To workaround this problem [...]]]></description>
			<content:encoded><![CDATA[<p>Have you been annoyed by the exception &#8220;<em>License violation! License is already in use at another online site</em>&#8221; when you switch from one web site to another on you developer machine?</p>
<p>I have and the reason is of course that I use my developer license file in more than one place.</p>
<p>To workaround this problem you can always restart <em>EPiServer Scheduler Service </em>and recycle your application with an <em>iisreset.</em></p>
<p>EPiServer appears to use the Scheduler Service for more things than just executing scheduled tasks. It is used when a central communication point is required like when you need to synchronize licenses between web applications&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/27/episerver-license-violation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Available Page Types in EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 13:24:59 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Available Page Types]]></category>
		<category><![CDATA[EPiServer 4]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/</guid>
		<description><![CDATA[It is a best practice to limit the number of Pages Types an editor can choose from when the editor creates a new page. As you probably know this is configured in Admin Mode on each Page Type. What you probably don&#8217;t think about is that these settings can make it impossible to import and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb10.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb10-thumb.png" border="0" alt="image_thumb[10]" width="244" height="191" align="right" /></a>It is a best practice to limit the number of Pages Types an editor can choose from when the editor creates a new page.</p>
<p>As you probably know this is configured in Admin Mode on each Page Type. What you probably don&#8217;t think about is that these settings can make it impossible to import and export pages.</p>
<h3>&#8220;Available Page Types&#8221;-rules can break import</h3>
<p>If your rules change over time or if you use Stop Publish and Archive Page so your pages moves around you can get in trouble with these rules.</p>
<p>In the current version (5.1.422.122 SP1) the import will stop with an error and it can be quite hard to figure out what is wrong.</p>
<p>I created a SQL-statement to help you figure out what is wrong. It will give you a list of all pages breaking the &#8220;Available Page Types&#8221;-rules. It lists the Parent and Child&#8217;s Page Id, Page Name and also Page Type.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image14.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb2.png" border="0" alt="image" width="504" height="283" /></a></p>
<p>This (messy) SQL statement for copy paste:</p>
<p><code>SELECT fkParentID AS ParentPageId, pkID AS ChildPageId, (SELECT Name FROM tblPage AS p2 WHERE (pkID = p.fkParentID)) AS ParentPageName, Name AS ChildPageName, (SELECT fkPageTypeID FROM tblPage AS p2 WHERE (pkID = p.fkParentID)) AS ParentPageTypeId, fkPageTypeID AS ChildPageTypeId FROM tblPage AS p WHERE (NOT EXISTS (SELECT fkPageTypeParentID, fkPageTypeChildID, Access FROM tblPageTypeToPageType AS tt WHERE (fkPageTypeParentID = (SELECT fkPageTypeID FROM tblPage AS p2 WHERE (pkID = p.fkParentID))) AND (fkPageTypeChildID = p.fkPageTypeID))) AND EXISTS (SELECT fkPageTypeParentID, fkPageTypeChildID, Access FROM tblPageTypeToPageType AS tt WHERE (fkPageTypeParentID = (SELECT fkPageTypeID FROM tblPage AS p2 WHERE (pkID = p.fkParentID)))) </code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/20/available-page-types-in-episerver/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Convert EPiServer Form to XForm</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/19/convert-episerver-form-to-xform/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/19/convert-episerver-form-to-xform/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 16:07:05 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[4.62]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[MigrationTool]]></category>
		<category><![CDATA[XForm]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/19/convert-episerver-form-to-xform/</guid>
		<description><![CDATA[You must get rid of your Form-properties and convert them to EPiServer XForm before you can migrate them to EPiServer 5. You can easily identify all form-properties on you site with some SQL: SELECT pt.pkID AS PageTypeId, pt.Name as PageType, pd.Name AS PropertyName, pt.Filename FROM tblPageDefinition AS pd INNER JOIN tblPageType AS pt ON pd.fkPageTypeID [...]]]></description>
			<content:encoded><![CDATA[<p>You must get rid of your Form-properties and convert them to EPiServer XForm before you can migrate them to EPiServer 5.</p>
<p>You can easily identify all form-properties on you site with some SQL:</p>
<p><code>SELECT pt.pkID AS PageTypeId, pt.Name as PageType, pd.Name AS PropertyName, pt.Filename<br />
FROM tblPageDefinition AS pd<br />
INNER JOIN tblPageType AS pt ON pd.fkPageTypeID = pt.pkID<br />
WHERE (pd.fkPageDefinitionTypeID = 9)<br />
ORDER BY pt.SortOrder, pd.FieldOrder</code></p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/03/image-thumb.png" alt="image" height="226" style="border: 0px" /></a>In admin mode there is a XForm Convert tool that can be used to convert existing Forms into XForms.</p>
<p>One of the differences between Forms and XForms is that the data for a Form is stored on a page but XForms are stored as a separate object in the ObjectStore.</p>
<p>The XForm property on you page only stores a GUID in a string that is a reference to the real XForm instance.</p>
<p>Do not change the type on an existing property from Form to XForm. That will only give you exceptions. Instead, create new properties and delete the old ones.</p>
<p>If you want better control over the conversion process use Lutz Reorder&#8217;s reflector to reverse engineer the class <em>EPiServer.Admin.ConvertFormToXform</em> in EPiServer.CodeBehind.dll.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/19/convert-episerver-form-to-xform/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Archive Page can create strange exceptions</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 10:54:37 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Archive page]]></category>
		<category><![CDATA[EPiServer 4]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/</guid>
		<description><![CDATA[If you export pages that have the Build-in property Archive Page set pointing to a page that is not included in your export package you will get an exception. At least if you are migrating from EPiServer 4 to 5.1. Use the following script if you want to clear all the value of Archive page [...]]]></description>
			<content:encoded><![CDATA[<p>If you export pages that have the Build-in property Archive Page set pointing to a page that is <em>not included</em> in your export package you will get an exception. At least if you are migrating from EPiServer 4 to 5.1.</p>
<p>Use the following script if you want to clear all the value of Archive page on all pages in your source database:</p>
<p><code>UPDATE tblPageTypeDefault<br />
SET fkArchivePageID = NULL</code></p>
<p>Remember to do a iisreset to invalidate all cached information after you change in the database.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/03/17/archive-page-can-create-strange-exceptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Export from EPiServer CMS 4</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/02/28/export-from-episerver-cms-4/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/02/28/export-from-episerver-cms-4/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 20:47:29 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Decrypt]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[XForm]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/02/28/export-from-episerver-cms-4/</guid>
		<description><![CDATA[As you probably know EPiServer CMS 5 does not encrypt the export packages like version 4 did. You can open them easily and look inside by changing the extension to zip. The export packages from EPiServer 4 is encrypted and sometimes when you try to import them in EPiServer 5 you get the most strange [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably know EPiServer CMS 5 does not encrypt the export packages like version 4 did. You can open them easily and look inside by changing the extension to zip.</p>
<p>The export packages from EPiServer 4 is encrypted and sometimes when you try to import them in EPiServer 5 you get the most strange and non helping exception (like NullReferenceException). I had this problem and the only solution I could find was to crack the encryption of the export package so I could look inside and find the error.</p>
<h3>Download the EPiServer 4 Export Package Decryption Tool</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/image.png"><img border="0" align="right" width="244" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/image-thumb.png" alt="image" height="122" style="border-width: 0px" /></a>If you have the same problem you can use the <a href="http://fredrikhaglund.se/blog/080228/EPi4Decrypt.zip">Decryption tool for EPiServer 4 Export Packages</a> that I created.</p>
<p>The tool takes to parameters. The first should be the encrypted export package file. The second should be a non-existing filename ending with &#8220;.zip&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/02/28/export-from-episerver-cms-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Get control over your assembly dependencies</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/02/23/get-control-over-your-assembly-dependencies/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/02/23/get-control-over-your-assembly-dependencies/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 09:54:01 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Assembly]]></category>
		<category><![CDATA[bindingRedirect]]></category>
		<category><![CDATA[FileLoadException]]></category>
		<category><![CDATA[Fusion]]></category>
		<category><![CDATA[Fuslogvw]]></category>
		<category><![CDATA[PlugInException]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/02/23/get-control-over-your-assembly-dependencies/</guid>
		<description><![CDATA[Suddenly everything stops working you do not have clue what’s gone wrong. You just get annoying exceptions thrown in your face explaining that it could not find a specific version of a DLL or that the located assembly’s manifest definition does not match the assembly reference. Sometimes you can see a Yellow Screen of Death [...]]]></description>
			<content:encoded><![CDATA[<p>Suddenly everything stops working you do not have clue what’s gone wrong. You just get annoying exceptions thrown in your face explaining that it could not find a specific version of a DLL or that the located assembly’s manifest definition does not match the assembly reference.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/ysod-could-not-load-file-or-assembly.png" title="YSOD-Could not load file or assembly"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/ysod-could-not-load-file-or-assembly.thumbnail.png" alt="YSOD-Could not load file or assembly" class="imageleft" /></a>Sometimes you can see a Yellow Screen of Death telling you that you application tries to use a version of an assembly that you know that you do not want to use. But why?</p>
<h3>Visual Studio add <em>&lt;assemblies&gt;</em> to web.config</h3>
<p>This can be a problem if you have several different versions of an assembly installed in the <a href="http://en.wikipedia.org/wiki/Global_Assembly_Cache">GAC</a> at the same time. Under some conditions Visual Studio thinks that you must add references to assemblies to be able to successfully compile your asp.net files. Unfortunately the added references have the opposite effect – nothing compiles!</p>
<pre><span style="color: blue"><span>    </span>&lt;</span><span style="color: #a31515">compilation</span><span style="color: blue"> </span><span style="color: red">defaultLanguage</span><span style="color: blue">=</span><span>&quot;<span style="color: blue">c#</span>&quot;<span style="color: blue"> </span><span style="color: red">debug</span><span style="color: blue">=</span>&quot;<span style="color: blue">true</span>&quot;<span style="color: blue">&gt;  </span></span>
<span style="color: blue"><span>      </span>&lt;</span><span style="color: #a31515">assemblies</span><span style="color: blue">&gt;</span><span style="color: blue">  </span>
<span style="color: blue"><span>         </span>&lt;</span><span style="color: #a31515">add</span><span style="color: blue"> </span><span style="color: red">assembly</span><span style="color: blue">=</span><span>&quot;<span style="color: blue">EPiServer, Version=5.1.422.122, Culture=neutral, PublicKeyToken=8FE83DEA738B45B7</span>&quot;<span style="color: blue">/&gt;</span></span><span><span style="color: blue">  </span></span>
<span style="color: blue"><span>         </span>[ . . . ]</span><span style="color: blue">  </span>
<span style="color: blue"><span>      </span></span><span style="color: blue">&lt;/</span><span style="color: #a31515">assemblies</span><span style="color: blue">&gt;</span><span style="color: blue">  </span>
<span style="color: blue"><span>    </span>&lt;/</span><span style="color: #a31515">compilation</span><span style="color: blue">&gt;</span></pre>
<p>As you know your asp.net files (global.asax, aspx-files, etc) are parsed and converted to C#-code that is then compiled with the C#-compiler when first accessed. The assemblies added in the &lt;assemblies&gt;-tag are added as references in the same way as you add references to a normal project in Visual Studio. You risk getting file not found errors or strange compilation errors. Since these references are parameters to the compiler, binding redirects in the runtime tag in web.config has no effect.</p>
<p><strong>Tip:</strong> Remove the whole <em>&lt;assemblies&gt;</em>-tag or at least all EPiServer references.</p>
<h3>Visual Studio adds <em>&lt;%@ Register %&gt;</em> to your markup</h3>
<p>Another place where you can get references to unwanted versions of assemblies added by Visual Studio is in you markup. Automatically added <em>&lt;%@ Register %&gt;</em> with strongly named references to assemblies will sooner or later cause problems for you. With strongly named I mean assembly names including version number and public key. If it is just a name it will load whatever version that is placed in your bin-folder.</p>
<p><strong>Tip:</strong> Always delete &quot;&lt;% @ Register TagPrefix =&quot;EPiServer&quot; … %&gt;&quot; from you markup.</p>
<p>The import of EPiServer controls are handled elsewhere. Take a look at the <em>&lt;pages&gt;&lt;controls&gt;</em>-tag in your <em>web.config</em> and you will understand. This also has the side effect of making most of EPiServer classes available in front-end code without adding the <em>&lt;assemblies&gt;</em>-tags.</p>
<p><strong>Tip:</strong> Consider adding you own controls to the <em>&lt;pages&gt;&lt;controls&gt;</em>-tag in your <em>web.config</em> instead of adding a <em>&lt;%@ Register %&gt;</em>-tag on every page.</p>
<p><strong>Tip:</strong> Remove the version number and public key from the assembly attribute.</p>
<h3>Use &lt;bindingRedirect&gt; in your web.config</h3>
<p>The key to be able to use a new version of an assembly without recompiling everything is the <em>&lt;bindingRedirect&gt;</em>-tag in <em>web.config</em>. EPiServer Manager updates this part of your <em>web.config</em> when you upgrade your site.</p>
<pre><span style="color: blue"><span>  </span>&lt;</span><span style="color: #a31515">runtime</span><span style="color: blue">&gt;  </span>
<span style="color: blue"><span>    </span>&lt;</span><span style="color: #a31515">assemblyBinding</span><span style="color: blue"> </span><span style="color: red">xmlns</span><span style="color: blue">=</span><span>&quot;<span style="color: blue">urn:schemas-microsoft-com:asm.v1</span>&quot;<span style="color: blue">&gt;</span></span><span>
<span style="color: blue"><span style="color: blue"><span>      </span>&lt;</span><span style="color: #a31515">dependentAssembly</span><span style="color: blue">&gt;</span></span></span>
<span style="color: blue"><span>        </span>&lt;</span><span style="color: #a31515">assemblyIdentity</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span><span>&quot;<span style="color: blue">EPiServer</span>&quot;<span style="color: blue"> </span><span style="color: red">publicKeyToken</span><span style="color: blue">=</span>&quot;<span style="color: blue">8fe83dea738b45b7</span>&quot;<span style="color: blue"> </span><span style="color: red">culture</span><span style="color: blue">=</span>&quot;<span style="color: blue">neutral</span>&quot;<span style="color: blue">/&gt;</span></span><span><span style="color: blue"><span style="color: blue">
<span>        </span>&lt;</span><span style="color: #a31515">bindingRedirect</span><span style="color: blue"> </span><span style="color: red">oldVersion</span><span style="color: blue">=</span><span>&quot;<span style="color: blue">5.0.0.0-5.65535.65535.65535</span>&quot;<span style="color: blue"> </span><span style="color: red">newVersion</span><span style="color: blue">=</span>&quot;<span style="color: blue">5.1.422.4</span>&quot;<span style="color: blue">/&gt;</span></span></span></span>
<span style="color: blue"><span>      </span>&lt;/</span><span style="color: #a31515">dependentAssembly</span><span style="color: blue">&gt;</span><span></span></pre>
<h3>FileLoadException</h3>
<p>Sometimes it is not obvious why an assembly fails to load. Turn on logging in Fusion to get more information that might help you track down the issue. (Fusion is the name of the part of the dot net framework responsible for loading assemblies)</p>
<p>There is a property on <em>System.IO.FileLoadException</em> called <em>FusionLog</em> that contains details on why an assembly failed to load. The content of this property is displayed on the Yellow Screen of Death.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/enable-fusion-log-with-regedit.png" title="Enable Fusion Log with RegEdit"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/enable-fusion-log-with-regedit.png" alt="Enable Fusion Log with RegEdit" style="width: 100%" /></a></p>
<p><strong>Tip:</strong> Enable assembly binding logging use <strong>Fusion Log Viewer</strong> (Fuslogvw.exe) or set the registry value <em>EnableLog</em> in <em>HKLM\Software\Microsoft\Fusion</em> to 1. Note that you have to restart your application (use <em>iisreset)</em> for the changes to have any effect.</p>
<p><strong>Tip:</strong> Remember to turn off fusion logging when you are done since there is a performance penalty to have it turned on.</p>
<h3>EPiServer PlugInException</h3>
<p>Sometimes the FileLoadException is an inner exception of another exception so the Yellow Screen of Death does not show the details from the fusion log. This is a quite common scenario for EPiServer since the first thing that happens when the application start is that EPiServer loads ALL assemblies in the bin-folder and searches for PlugIn-attributes.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/assembly-binding-log-viewer-fuslogvw.png" title="Assembly Binding Log Viewer - fuslogvw"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/assembly-binding-log-viewer-fuslogvw.png" alt="Assembly Binding Log Viewer - fuslogvw" style="width: 100%" /></a></p>
<p><strong>Tip:</strong> In these cases you can change the setting in the Assembly Binding Log Viewer to &quot;Log bind failures to disk&quot; and get all the details you need to track down the issue. I also recommend using a custom log path.</p>
<h3>Fix your references by editing your csproj-file</h3>
<p>Finally, take a look at your csproj file using notepad (or unload the project in Visual Studio to be able to open it as text). When you add references using Visual Studio you will get a assembly reference with both version number and public key and this can give you some trouble when you upgrade a vendor assembly to a newer version.</p>
<pre><span style="color: blue"><span>    </span>&lt;</span><span style="color: #a31515">Reference</span><span style="color: blue"> </span><span style="color: red">Include</span><span style="color: blue">=</span><span><span style="color: #000000">&quot;</span><span style="color: blue">StarSuite.Core</span><span style="color: #000000">&quot;</span><span style="color: blue">&gt;</span></span><span><span style="color: blue">  </span></span>
<span style="color: blue"><span>      </span>&lt;</span><span style="color: #a31515">SpecificVersion</span><span style="color: blue">&gt;</span><span><span style="color: #000000">False</span><span style="color: blue">&lt;/</span><span style="color: #a31515">SpecificVersion</span><span style="color: blue">&gt;  </span></span>
<span style="color: blue"><span>      </span>&lt;</span><span style="color: #a31515">HintPath</span><span style="color: blue">&gt;</span><span><span style="color: #000000">..\Lib\StarSuite.Core.dll</span><span style="color: blue">&lt;/</span><span style="color: #a31515">HintPath</span><span style="color: blue">&gt;</span></span><span><span style="color: blue">  </span></span>
<span><span style="color: blue"><span style="color: blue"><span>      </span></span><span style="color: blue">&lt;</span><span style="color: #a31515">Private</span><span style="color: blue">&gt;</span><span><span style="color: #000000">True</span><span style="color: blue">&lt;/</span><span style="color: #a31515">Private</span><span style="color: blue">&gt;  </span></span>
<span><span style="color: blue"><span style="color: blue"><span>    </span>&lt;/</span><span style="color: #a31515">Reference</span><span style="color: blue">&gt;</span></span></span></span></span></pre>
<p><strong>Tip</strong>: Edit your csproj-file as text and keep only the assembly name. When you have removed the version and public key.</p>
<p><strong>Tip</strong>: Create a Library-folder and store a copy of all references assemblies. It can be very nice to have if Visual Studio decides that it want to clean the bin folder and removes files that you need there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/02/23/get-control-over-your-assembly-dependencies/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tip of the day: Simplify Testing of Registration</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/02/06/tip-of-the-day-simplify-testing-of-registration/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/02/06/tip-of-the-day-simplify-testing-of-registration/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 15:09:45 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Activation]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[Registration]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/02/06/tip-of-the-day-simplify-testing-of-registration/</guid>
		<description><![CDATA[Many of us have implemented registration procedures both in generic ASP.NET sites and also in EPiServer. One of the more annoying things when you as a developer or tester works with the registration procedure and have to test email activation. It usually requires an unique email address every time. After a short while you have [...]]]></description>
			<content:encoded><![CDATA[<p>Many of us have implemented registration procedures both in generic ASP.NET sites and also in EPiServer.</p>
<p>One of the more annoying things when you as a developer or tester works with the registration procedure and have to test email activation. It usually requires an unique email address every time. After a short while you have used you work and private email addresses and have to either create a bunch of aliases or delete existing accounts so you can retest&#8230;</p>
<h3>Endless supply of email addresses</h3>
<p class="insert insertright"><a href="http://dodgit.com/run/checkmail?mailbox=user1">user1@dodgit.com</a>, <a href="http://dodgit.com/run/checkmail?mailbox=user2">user2@dodgit.com</a>, <a href="http://dodgit.com/run/checkmail?mailbox=user3">user3@dodgit.com</a>, &#8230;</p>
<p>To the rescue comes a few services with free disposable read-only email addresses. They are mainly designed for avoiding getting spam when you have to register somewhere on Internet but can also be used to get an infinite number of email addresses!</p>
<p>Try <a href="http://www.mailinator.com/">Mailinator</a> or <a href="http://www.dodgeit.com/">Dodgeit</a>. The later is my favourite because of it&#8217;s minimalistic interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/02/06/tip-of-the-day-simplify-testing-of-registration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Tuning and Optimization of EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 15:17:08 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Application Pool]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[DataFactory]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[memoryLimit]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/</guid>
		<description><![CDATA[There are many factors to look at when you want to tune the performance of your EPiServer site. This is the first post about common pitfalls and how to optimize EPiServer for performance. EPiServer and Memory First thing to check is that you have enough memory. EPiServer needs a lot of memory to cache the [...]]]></description>
			<content:encoded><![CDATA[<p>There are many factors to look at when you want to tune the performance of your EPiServer site. This is the first post about common pitfalls and how to optimize EPiServer for performance.</p>
<h3>EPiServer and Memory</h3>
<p>First thing to check is that you have enough memory. EPiServer needs a lot of memory to cache the PageData object for each of all active pages on the site. The larger site (more pages) you have, the more memory you will need.</p>
<p>The <code>DataFactory</code> class will first look if the requested page or list of pages is in the cache when you call <code>GetPage()</code> or <code>GetChildren()</code>. If it is not in the cache, the page or list will be loaded from the database and added to the cache. The default implementation (<a href="http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/TechNotes/EPiServer-CMS-5-SP1/Pluggable-Runtime-Cache/">read more about pluggable runtime cache</a>) uses ASP.NET&#8217;s built-in public cache to store pages and lists in memory.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/episerver-database-cache-usage.png" title="EPiServer Database Cache Usage"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/episerver-database-cache-usage.thumbnail.png" alt="EPiServer Database Cache Usage" class="imageright" /></a>The public cache in ASP.NET is also used to store other data in addition to EPiServer PageData and Lists. Periodically ASP.NET will use a Least Recently Used (LRU) algorithm to scavenge the cache for more space. If the memory pressure is very high the lifetime of cached items can be very short or even zero (not added at all). This is not good for EPiServer&#8217;s performance.</p>
<p>It is easy to see what&#8217;s inside your cache:</p>
<pre><code><span style="color: blue; ">protected</span><span style=""> <span style="color: blue">void</span> Page_Load(<span style="color: blue">object</span> sender, <span style="color: #2b91af">EventArgs</span> e)
</span><span style="">{
</span><span style=""><span>    </span><span style="color: blue">foreach</span> (<span style="color: #2b91af">DictionaryEntry</span> d <span style="color: blue">in</span> <span style="color: blue">this</span>.Cache)
</span><span style=""><span>    </span>{
</span><span style=""><span>        </span>Response.Write(d.Key);
</span><span style=""><span>        </span>Response.Write(<span style="color: teal">" - "</span>);
</span><span style=""><span>        </span>Response.Write(d.Value);
</span><span style=""><span>        </span>Response.Write(<span style="color: teal">"&lt;hr&gt;"</span>);</span><span style=""><span>
</span></span><span style=""><span>    </span>}
</span><span style="">}</span><span></span></code></pre>
<p>A very good indicator if Memory is an issue is to look at some statistics from the DataFactory class. You can see the <em>Cache hit rate</em> if you go to admin mode. <strong>It should be close to 100%</strong> or maybe a few percent below. (It is normal that it drops to zero when you restart the site but it should climb fast.) A constant low value is one indicator that you need more memory because PageData objects are thrown out of the cache and then they must be reloaded from the database.<a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/add-episerver-performance-counters.png" title="Add EPiServer Performance Counters"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/add-episerver-performance-counters.thumbnail.png" alt="Add EPiServer Performance Counters" class="imageleft" /></a>You can also see the <em>Cache Hit Ratio</em> (and some other counters) through Windows Performance Monitor. This is a good value to monitor in a hosting environment and add an alert when the value becomes to low.</p>
<h3>ASP.NET Worker Process / Application Pool</h3>
<p>The maximum memory ASP.NET allows a worker process to consume before it is recycled is by default 60% of the total system memory. <a href="http://msdn2.microsoft.com/en-us/library/7w2sway1.aspx">Read more about memoryLimit tag</a>.<br />
<code><br />
&lt;system.web&gt;<br />
  &lt;processModel&gt;<br />
    &lt;memoryLimit&gt;60&lt;/memoryLimit&gt;<br />
  &lt;/processModel&gt;<br />
&lt;/system.web&gt;<br />
</code><br />
<strong>Default Application Pool</strong> &#8211; Do not use it and do NOT delete it (even if you plan to never use it). Create your own pool instead but not create one pool for each site on the web server. Instead consolidate your applications into one pool and only use a separate pool for troublesome web applications. You must have separate pools for ASP.NET 1.1 and 2.0 applications though.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-recycling.png" title="Application Pool Recycling"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-recycling.thumbnail.png" alt="Application Pool Recycling" class="imageright" /></a>You can also configure the application pool to recycle if it consumes to much memory. If you <strong>worker process constantly recycles</strong> you need to find out why because EPiServer will always be a little bit sluggish after a restart (before data is cached again). You also loose all in-process session data when the process restarts which is an issue of its own.</p>
<p><strong>Settings</strong>: I recommend that you uncheck &#8220;Recycle worker process (in minutes)&#8221; and use &#8220;Recycle worker process at the following times&#8221; instead.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-performance.png" title="Application Pool Performance"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/application-pool-performance.thumbnail.png" alt="Application Pool Performance" class="imageleft" /></a> You should also uncheck &#8220;Shutdown worker process after being idle&#8221;. This is very important for EPiServer sites that has a low traffic (for example during the night).</p>
<p><strong>Do not use Web Garden</strong> unless you know what you are doing. It will require double memory for the cache and out of process state-handling. If you change the number of worker processes from 1 to 2 it is like having two web servers on the same box with IIS acting like load balancer. (It is a cheap way in a development environment to test how you application will behave in a farm with load balancing.)</p>
<h3>MSSQL Server and EPiServer</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/mssql-server-properties-memory.png" title="MSSQL Server Properties Memory"><img src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/02/mssql-server-properties-memory.thumbnail.png" alt="MSSQL Server Properties Memory" class="imageright" /></a>Its a best practice to have two machines, one for the web server and one for the database. But sometimes you have to run the database on the same machine as the web server. If you do, it is important to remeber that the MSSQL Server competes with the Web Server for resources like memory. You should <strong>always limit the amount of memory the database can use</strong> because it is better for EPiServer to have data cached in the web application than in the database.</p>
<p>Usually the usage of the database is low (around 5% CPU) in EPiServer scenarios because EPiServer tries to cache what it needs in the web application. If you have a higher usage of the database this can be an indication of that caching does not work as it should in the web application but it could also indicate that you do something else wrong. (More about database issues in a later post.)</p>
<h3>Other processes</h3>
<p>Finally, do not forget to have use the ordinary task manager to check if you have other processes that compete for the memory on your web server.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/02/01/performance-tuning-and-optimization-of-episerver/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>About Searching inside Uploaded Files</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/01/25/about-searching-inside-uploaded-files/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/01/25/about-searching-inside-uploaded-files/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 12:23:05 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[IFilter]]></category>
		<category><![CDATA[IndexingService]]></category>
		<category><![CDATA[Lucene]]></category>
		<category><![CDATA[Microsoft Indexing Service]]></category>
		<category><![CDATA[Unified File System]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/01/25/about-searching-inside-uploaded-files/</guid>
		<description><![CDATA[EPiServer uses both an open source library (Lucene) and Microsoft Indexing Service to create the search index for files. In EPiServer 4 was Microsoft Indexing Service responsible for building an index for ordinary files (i.e. the upload folder) and EPiServer Indexing Service was needed to get the versioned files in the documents folder indexed. The [...]]]></description>
			<content:encoded><![CDATA[<p>EPiServer uses both an open source library (<a href="http://lucene.apache.org/">Lucene</a>) and <a href="http://msdn2.microsoft.com/en-us/library/ms689718.aspx">Microsoft Indexing Service</a> to create the search index for files.</p>
<p>In <strong>EPiServer 4</strong> was Microsoft Indexing Service responsible for building an index for ordinary files (i.e. the <em>upload </em>folder) and EPiServer Indexing Service was needed to get the versioned files in the <em>documents </em>folder indexed. The reason EPiServer has to implement their own search for the documents folder is because the path and file name is stored in the database and the content in a file with a guid as name.</p>
<p>In <strong>EPiServer CMS 5</strong> all files are stored using the <em>VirtualPathVersioningProvider </em>(that always stores the path and file name in the database and the content as a file with a GUID as name). For this reason must the EPiServer Indexing Service be running and the web site configured to use it if you want to search files.</p>
<h3>So how does the keywords get into the index?</h3>
<p>You can not just take the content of a binary word document or pdf-file. The binary file must be converted to text first and for this EPiServer relies on a part of Microsoft Indexing Service. Applications can register converters the implement a COM-interface (<a href="http://blogs.msdn.com/ifilter/">IFilter</a>) and this is used by Microsoft Indexing Service, SharePoint, EPiServer or any application intrested in getting the text out of a binary document.</p>
<p>You can have a look on the implementation with <a href="http://www.aisto.com/roeder/dotnet/">Lutz Roeder&#8217;s .NET Reflector </a>if you load the <em>EPiServer.InexingService.exe</em> and look at the class: <em>EPiServer.IndexingService.Indexers.FileItemIndexer</em></p>
<h3>Do  you want to create your own EPiServer File System?</h3>
<p>A little more analysis reveals (at least with the 5.1.422 version) that EPiServer Indexing Service does not ask the <em>VirtualPathProvider</em> class for the content of the file! Instead it has hardcoded knowledge of the physical location used by the <em>VirtualPathVersioningProvider</em> (see <em>EPiServer.IndexingService.ItemIndexerManager.CreateDocument</em>). This makes it impossible to create your own implementation of EPiServer&#8217;s Unified File System and get the files indexed correctly.</p>
<p>See also:  <a href="http://blog.fredrikhaglund.se/blog/2008/01/07/storing-metadata-attached-to-uploaded-files/">Storing metadata attached to uploaded files</a> and <a href="http://www.google.se/search?hl=sv&amp;q=technotes+%22Microsoft+Index+Server%22+site%3Aepiserver.com">EPiServer Tech Notes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/01/25/about-searching-inside-uploaded-files/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Configure EPiServer File Manager</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 20:03:07 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[File Manager]]></category>
		<category><![CDATA[Page Folder]]></category>
		<category><![CDATA[PageFolderID]]></category>
		<category><![CDATA[pageFolderVirtualPathProvider]]></category>
		<category><![CDATA[showInFileManager]]></category>
		<category><![CDATA[Unified File System]]></category>
		<category><![CDATA[Virtual Path Providers]]></category>
		<category><![CDATA[virtualPath]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/</guid>
		<description><![CDATA[I got a question about the File Manager from one of the attendees on my last EPiServer Developer training and I will share my answer with you. You control the name, order and number of starting points in the File Manager for EPiServer CMS 5 by adding or removing Virtual Path Provides in web.config. &#60;virtualPath [...]]]></description>
			<content:encoded><![CDATA[<p>I got a question about the File Manager from one of the attendees on my last EPiServer Developer training and I will share my answer with you.</p>
<p>You control the name, order and number of starting points in the File Manager for EPiServer CMS 5 by adding or removing Virtual Path Provides in web.config.</p>
<pre><code>&lt;virtualPath customFileSummary="~/FileSummary.config"&gt; 

  &lt;providers&gt;  

    &lt;add showInFileManager="false" virtualName="Page Files" virtualPath="~/PageFiles/" ... /&gt;  

    &lt;add showInFileManager="true" virtualName="Global Files" virtualPath="~/Global/" ... /&gt;  

    &lt;add showInFileManager="true" virtualName="Documents" virtualPath="~/Documents/"... /&gt;  

</code></pre>
<p>The virtualName is what you see in the File Manager.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/filemanager.png" title="EPiServer File Manager"><img width="100%" src="http://blog.fredrikhaglund.se/wp-content/uploads/2008/01/filemanager.png" alt="EPiServer File Manager" /></a></p>
<p>You can hide providers from the File Manager by changeing the showInFileManager attribute to false but these providers will still be available from code. This can be usefull for generated thumbnail and similar.</p>
<p>If you open the File Manager without a page selected the first visible provider in the list will get focus.</p>
<p>There is usually a current page when you open the file manager in edit mode (either in the action window or as a modal dialog) and you will always see the page folder or get a question if you want to create a new page folder if it does not exist. There is currently no way to disable page folders in the current (5.1.422) release as far as I know.</p>
<p>Which Virtual Path Provider that is used to store Page Folders is also controlled in web.config.</p>
<pre><code>&lt;episerver ...&gt; 

  &lt;sites&gt;  

    &lt;site ...&gt;  

      &lt;siteSettings ... pageFolderVirtualPathProvider="SitePageFiles" ... /&gt;  

</code></pre>
<p>A common mistake is to mix up the Page ID and the Page&#8217;s Folder ID. They are two separate number sequences and there is a property on the PageData obeject that stores the folder id for each page.</p>
<pre><code>CurrentPage.Property["PageFolderID"].Value  

</code></pre>
<p>Follow this link to see more <a href="http://blog.fredrikhaglund.se/blog/2007/12/05/episerver-using-the-new-unified-file-system/">examples on how to use EpiServers Unified File System</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/01/21/configure-episerver-file-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web.config, version control and nice formatting</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/01/12/webconfig-version-control-and-nice-formatting/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/01/12/webconfig-version-control-and-nice-formatting/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 18:34:43 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=59</guid>
		<description><![CDATA[EPiServer has a site tag with a lot of attributes. When you change the web.config from EPiServer Manager or by calling Save on the Configuration class yourself all attributes will be on one looong line (this is default behaivour by the dotnet framework so its not EPiServers fault). If you put web.config under version control [...]]]></description>
			<content:encoded><![CDATA[<p>EPiServer has a site tag with a lot of attributes. When you change the web.config from EPiServer Manager or by calling Save on the Configuration class yourself all attributes will be on one looong line (this is default behaivour by the dotnet framework so its not EPiServers fault).</p>
<p>If you put <em>web.config</em> under version control and would prefer if changes to singe attributes are easy to detect with a diff tool, this is not the optimal.</p>
<p>It is possible to change formatting in Visual Studio to get one attribute per line and that works much better for text diff tools. (This requires that you do your changes with Notepad or Visual Studio and not use EPiServer Manager or the Admin Mode to change the settings.)</p>
<p>Go to Tools -&gt; Options -&gt; Text Editor -&gt; XML -&gt; Formatting and select &#8220;Align attributes each on a separate line&#8221;</p>
<p>Click Edit -&gt; Advanced -&gt; Format Document (or Format Selection if you only want to adjust a part of the file) before you check in your <em>web.config</em> to reformat.</p>
<p>Voilà! Your <em>web.config</em> is readable!</p>
<p>(See also <a href="http://www.episerver.com/en/EPiServer_Knowledge_Center/Developer-Forum2/EPiServer-Developer-Forums-/EPiServer-CMS-version-5/14774/">discussion in EPiServer Developer Forum</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/01/12/webconfig-version-control-and-nice-formatting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Profile Data in EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2007/11/28/profile-data-in-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2007/11/28/profile-data-in-episerver/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 10:09:06 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[EPiServerProfile]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=52</guid>
		<description><![CDATA[To store settings for the current user, use the built-in Profile support in ASP.NET. EPiServer is using this for its own need to store information on a per user basis. (The built-in values EPiServer needs are accessible through the class EPiServerProfile that is a subclass of the ASP.NET class ProfileBase). You can get access to [...]]]></description>
			<content:encoded><![CDATA[<p>To store settings for the current user, use the built-in Profile support in ASP.NET.</p>
<p>EPiServer is using this for its own need to store information on a per user basis. (The built-in values EPiServer needs are accessible through the class <em>EPiServerProfile</em> that is a subclass of the ASP.NET class <em>ProfileBase</em>).</p>
<p>You can get access to the current users EPiServer&#8217;s Profile instance accessing the static property <strong>Current</strong> on the <em>EPiServerProfile</em> class. There is also a default indexer property inherited from ASP.NET&#8217;s <em>ProfileBase</em> class that you can use for you own values.</p>
<pre><code>EPiServer.Personalization.EPiServerProfile.Current["MySetting"] = "Test123";
			</code></pre>
<p>For performance reasons use only <em>string</em>, <em>int</em>, <em>DateTime</em> and avoid objects that must be serialized. There is also support for handling anonymous users (not logged in) if needed.</p>
<p>Read more: <a href="http://msdn2.microsoft.com/en-us/library/at64shx3.aspx">http://msdn2.microsoft.com/en-us/library/at64shx3.aspx</a></p>
<p><strong>Update</strong>: <a href="http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/Release-Notes/Release-Notes---EPiServer-CMS-5-SP1/">Read more about changes to Profile information in SP1 for EPiServer CMS 5 R1</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2007/11/28/profile-data-in-episerver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Properties with Special Functionality in EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2007/11/03/properties-with-special-functionality-in-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2007/11/03/properties-with-special-functionality-in-episerver/#comments</comments>
		<pubDate>Sat, 03 Nov 2007 14:36:26 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer Property]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=44</guid>
		<description><![CDATA[In addition to the build-in properties on EPiServer pages there are some additional user defined properties that have a special function from EPiServers point of view. As a beginner to EPiServer it is easy to miss this so after teaching new developers this week I thought I should hunt the down and make a list. [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to the build-in properties on EPiServer pages there are some additional user defined properties that have a special function from EPiServers point of view. As a beginner to EPiServer it is easy to miss this so after teaching new developers this week I thought I should hunt the down and make a list.</p>
<p>The property can either be defined directly on a page type or as a dynamic property so the value it can be inherited in a branch of the page tree. It is possible to both define properties as a dynamic and on page types. In this case the value on the page is used first.</p>
<table border="1">
<tr>
<th>Context</th>
<th>Property name</th>
<th>Description</th>
</tr>
<tr>
<td vAlign="top">XHtml Editor,<br />
XForms Editor</td>
<td vAlign="top">UIEditorCssPaths</td>
<td vAlign="top">Comma separated list of css-files that is used in the xhtml editor. Each path should start with ~ to be relative to the application root. If there is no value set on the page or in a dynamic property it falls back to a setting on the siteSettings tag in web.config.The editor and some of it&#8217;s supporting dialogs is using the css-files to populates the class drop down list. EPiServer has a parser in javascript that looks for a special attribute &#8216;EditMenuName&#8217; that is used as the human readable name for a style.</td>
</tr>
<tr>
<td vAlign="top">PageTemplateContainer PreviewText</td>
<td vAlign="top">MainIntro, MainBody</td>
<td vAlign="top">The PreviewText function is used to get a short description of the text. It takes the value from MainIntro and falls back to MainBody if it is blank. All html tags in MainBody is removed and only the first 400 characters is used.(PreviewText is using a regular expression to trim html tags and this can take some time if all pages in a long listing is missing MainIntro. Worth considering if you have performance issues with a listing.)</td>
</tr>
<tr>
<td vAlign="top">SubscriptionMail</td>
<td vAlign="top">MainIntro, MainBody</td>
<td vAlign="top">Properties expected on each page that should be subscribeable. MainInto and MainBody is used when generating the e-mail.</td>
</tr>
<tr>
<td vAlign="top">SubscriptionMail</td>
<td vAlign="top">EPSUBSCRIBE-EXCLUDE, EPSUBSCRIBEHIDDEN, EPSUBSCRIBE</td>
<td vAlign="top">EPSUBSCRIBE, EPSUBSCRIBEHIDDEN and EPSUBSCRIBE-EXCLUDE is used in diffrent parts of the Subscription mail mechanism and I have to write another blog post about the exact function of them.</td>
</tr>
<tr>
<td vAlign="top">SubscriptionDataSource</td>
<td vAlign="top">EPSUBSCRIBE-ROOT</td>
<td vAlign="top">Defines the startpage for SubscriptionDataSoruce.</td>
</tr>
<tr>
<td vAlign="top">SubscriptionMail</td>
<td vAlign="top">MailReadMore, MailSubject, MailFrom</td>
<td vAlign="top">Properties expected to be present on the subscription page that controls the sent message.</td>
</tr>
<tr>
<td vAlign="top">Calendar</td>
<td vAlign="top">ValidDays, EventStartDate,<br />
EventStopDate</td>
<td vAlign="top">The Calendar WebControl can create a list of all events between two dates. Event pages must have EventStartDate and EventStopDate to be included. ValidDays are optional but can be used to filter on which days a recurring event should be listed.</td>
</tr>
<tr>
<td vAlign="top">XForms</td>
<td vAlign="top">DefaultFormFolder</td>
<td vAlign="top">This is usually a dynamic property used to make life simpler for editors. You can organise your XForms into folders and if this property exists it will open the XForms editor with the folder matching the value as select.</td>
</tr>
<tr>
<td vAlign="top">SearchDataSource</td>
<td vAlign="top">PageRank, IconPath, MainIntro</td>
<td vAlign="top">This is read-only properties on the pages returned by a SearchDataSource.If you enable search in files temporary PageData objets are created for files that includes PageName for filename, PageChanged for when the file was uploaded and PageLinkUrl for the link to the file.</td>
</tr>
<tr>
<td vAlign="top">SiteMapProvider</td>
<td vAlign="top">PageSiteMapProvider</td>
<td vAlign="top">Used to get a SiteMapProvider from a Page. The name should match a SiteMapProvider defined in web.config.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">IsDocumentPageType</td>
<td vAlign="top">Controls if the client application should upload a copy of the original document. This will also be sent to the convert scripts that will skip building a rich HTML version if this property has not been set.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">DocumentInternalPath</td>
<td vAlign="top">If the IsDocumentPageType is set, this property will contain the path to the uploaded source document.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">DocumentInternalHtmlPath</td>
<td vAlign="top">If the IsDocumentPageType is set, this property will contain the path to the starting point for the rich HTML version.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">DocumentExternalPath</td>
<td vAlign="top">The path to the location of the source document may be used, for example, by other editors to see which document was used to publish this page.</td>
</tr>
<tr>
<td vAlign="top">OfficeIntegration</td>
<td vAlign="top">AllowDocumentUpdate</td>
<td vAlign="top">Controls if the client application should add properties to the word document so that the user can republish the document.</td>
</tr>
</table>
<p>This list does not include properties used by the public templates. I&#8217;m pretty sure I missed some properties so please, write a comment if you know of anyone I missed!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2007/11/03/properties-with-special-functionality-in-episerver/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Things noticed last week</title>
		<link>http://blog.fredrikhaglund.se/blog/2007/10/23/things-noticed-last-week/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2007/10/23/things-noticed-last-week/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 09:30:10 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[aspnet_compile]]></category>
		<category><![CDATA[Export/Import]]></category>
		<category><![CDATA[Globalization]]></category>
		<category><![CDATA[Toolbox]]></category>
		<category><![CDATA[XForms]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=43</guid>
		<description><![CDATA[Import/Export EPiServer CMS (5.1.422) has some issues with Export and Import I had to work around. If you notice that your XForms does not import as they should the only way to recover those pages is to go into the database and clear the guid in the string column in the tblWorkProperty table. How to [...]]]></description>
			<content:encoded><![CDATA[<h3>Import/Export</h3>
<p>EPiServer CMS (5.1.422) has some issues with Export and Import I had to work around. If you notice that your <strong>XForms </strong>does not import as they should the only way to recover those pages is to go into the database and clear the guid in the string column in the <em>tblWorkProperty</em> table. How to find the interesting rows in the <em>tblWorkProperty</em> table? Use the <em>PageDefinitionID</em>! You can find the ID in the <em>tblPageDefinition </em>table where all your properties for page types are defined. The reason it fails so fatally is because you have a GUID reference to an serialized object that should exist in the <em>tblItem </em>table but something goes wrong during import and you end up with broken references in the database.</p>
<h3>Globalization</h3>
<p>If you have <a href="http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/TechNotes/CMS-Tech-Notes/Globalization/">globalization </a>turned on and use the <a href="http://www.episerver.com/en/EPiServer_Knowledge_Center/Documentation/TechNotes/CMS-Tech-Notes/Globalization/#Scenario 2: Local Domains Mapped to Languages">&lt;siteHosts&gt;</a>tag to define several domains you might notice that EPiServer sometimes returns the wrong language. Something is broken in the <em>FriendlyUrlRewriteProvider</em>and you must patch your web.config to get it working:</p>
<p><code>&lt;add name="EPiServerFriendlyUrlRewriteProvider" type="EPiServer.Web.FriendlyUrlRewriteProvider,EPiServer" <strong><em>friendlyUrlCacheAbsoluteExpiration="0:0:0"</em></strong> /&gt;</code></p>
<p>Not good for performance but it works until next release of EPiServer <img src='http://blog.fredrikhaglund.se/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3>aspnet_compile</h3>
<p>Do not try to use aspnet_compile (or indirectly through Web Deployment Projects) on your EPiServer site because screws up how VirtualPathProviders work and EPiServer does not support it in this release. But DO use it to validate that your code in aspx files is compilable in your build scripts. You might have to delete some of EPiServers code in-front files because their back-end classes are no longer included (i.e. Util/ExplorerTreeBranch.aspx, Admin/Languages.aspx and Edit/SidBrowse.aspx)</p>
<h3>Tools</h3>
<p><a href="http://www.araxis.com">Araxis Merge </a>appears to be an excellent compare and merge utility. What is you favourite tool?</p>
<p><a href="http://www.websitepulse.com">WebSitePulse </a>is an easy but powerful tool to monitor that your site is working as it should. It can send SMS to tell you when something is not working and provide you with up-time statistics.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2007/10/23/things-noticed-last-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

