<?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>Rizo&#039;s &#187; Developing</title>
	<atom:link href="http://www.from-rizo.se/category/developing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.from-rizo.se</link>
	<description>A blog that brings up subjects regarding developing web applications, Android applications and gaming overall</description>
	<lastBuildDate>Sat, 08 May 2010 07:36:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FindPagesWithCriteria with PropertyCriteria and PropertyDataType.Boolean set to false</title>
		<link>http://www.from-rizo.se/2010/05/08/findpageswithcriteria-with-propertycriteria-and-propertydatatype-boolean-set-to-false/</link>
		<comments>http://www.from-rizo.se/2010/05/08/findpageswithcriteria-with-propertycriteria-and-propertydatatype-boolean-set-to-false/#comments</comments>
		<pubDate>Sat, 08 May 2010 07:36:57 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[Episerver]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=425</guid>
		<description><![CDATA[<p>Huge title but pretty much what this post is about. </p>
<p>To optimize your FindPagesWithCriteria, it&#8217;s good to be as specific as you can. i.e not use one criteria, get 500 hits back and then just use the top 5 out of those. Anyway, when using a PropertyDataType.Boolean and you want to get back those pages [...]]]></description>
			<content:encoded><![CDATA[<p>Huge title but pretty much what this post is about. </p>
<p>To optimize your FindPagesWithCriteria, it&#8217;s good to be as specific as you can. i.e not use one criteria, get 500 hits back and then just use the top 5 out of those. Anyway, when using a PropertyDataType.Boolean and you want to get back those pages that has this set to &#8220;false&#8221; you can&#8217;t really set the value to &#8220;false&#8221;. Why? Because when the property is false, it has never been set which makes it null.</p>
<p>Let&#8217;s see the code:</p>
<pre class="brush: c#">
PropertyCriteria crit = new PropertyCriteria{
            Condition = CompareCondition.Equal,
            Name = ContentPropertyStrings.Finished,
            Type = PropertyDataType.Boolean,
            Value = &quot;false&quot;,
            Required = true
};
</pre>
<p>The code above won&#8217;t give you any hits since there won&#8217;t be any property set to false, because those properties are null. What you need to do is what you can see below.</p>
<pre class="brush: c#">
PropertyCriteria crit = new PropertyCriteria{
            Condition = CompareCondition.Equal,
            Name = ContentPropertyStrings.Finished,
            Type = PropertyDataType.Boolean,
            IsNull = true,
            Required = true
};
</pre>
<p>An old problem but I still get this question from time to time so might aswell post it <img src='http://www.from-rizo.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2010/05/08/findpageswithcriteria-with-propertycriteria-and-propertydatatype-boolean-set-to-false/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to modify and publish a page programmatically in EPiServer</title>
		<link>http://www.from-rizo.se/2010/04/28/how-to-modify-and-publish-a-page-programmatically-in-episerver/</link>
		<comments>http://www.from-rizo.se/2010/04/28/how-to-modify-and-publish-a-page-programmatically-in-episerver/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 13:25:14 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[CreateWritableClone]]></category>
		<category><![CDATA[Episerver]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=420</guid>
		<description><![CDATA[<p>When you want to alter a page programmatically you need to use EPiServers CreateWriteableClone on the working page. This is because the Page itself is readonly. Now, there&#8217;s plenty of info out there how to do this, but just to refresh your mind, here&#8217;s some code:</p>

PageData clone = pd.CreateWritableClone();
clone.Property[&#34;MyProperty&#34;] = &#34;New value&#34;;
DataFactory.Instance.Save(clone, SaveAction.Publish);

<p>Simple enough, right?</p>
<p>Now, [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to alter a page programmatically you need to use EPiServers CreateWriteableClone on the working page. This is because the Page itself is readonly. Now, there&#8217;s plenty of info out there how to do this, but just to refresh your mind, here&#8217;s some code:</p>
<pre class="brush: c#">
PageData clone = pd.CreateWritableClone();
clone.Property[&quot;MyProperty&quot;] = &quot;New value&quot;;
DataFactory.Instance.Save(clone, SaveAction.Publish);
</pre>
<p>Simple enough, right?</p>
<p>Now, here&#8217;s the catch. If you are for example saving page ID&#8217;s into a customproperty, simply like this &#8220;42 43 553 23&#8243; and so forth and you want to change this programmatically by removing one and adding one. So for example, going from &#8221;42 43 553 23&#8243; to &#8221;42 43 55&#8243; won&#8217;t work with the code above. The result will be &#8220;42 43 553 23 55&#8243; as it will only add it up to your current value. So you want to clear your value before you set it although that is also not enough. You&#8217;ll have to save the page after you clear it and THEN you can set your new value and save the page. Something like this</p>
<pre class="brush: c#">
PageData clone = pd.CreateWritableClone();
clone.Property[&quot;MyProperty&quot;].Clear();
DataFactory.Instance.Save(clone, SaveAction.Publish);
clone.Property[&quot;MyProperty&quot;] = &quot;New value&quot;;
DataFactory.Instance.Save(clone, SaveAction.Publish);
</pre>
<p>If someone has a better way to override values without having to doublesave, please do let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2010/04/28/how-to-modify-and-publish-a-page-programmatically-in-episerver/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using FindPagesWithCriteria with CustomProperties</title>
		<link>http://www.from-rizo.se/2010/04/28/using-findpageswithcriteria-with-customproperties/</link>
		<comments>http://www.from-rizo.se/2010/04/28/using-findpageswithcriteria-with-customproperties/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 09:04:58 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[Episerver]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=418</guid>
		<description><![CDATA[<p>FindPagesWithCriteria is a very handy way to pick up pages that are spread out around your site but there&#8217;s a tiny thing that is good to remember when using FindPagesWithCriteria to find pages based on a CustomProperites that you&#8217;ve made. Never ever forget to click &#8220;searchable property&#8221;  when you add the customproperty to your page. [...]]]></description>
			<content:encoded><![CDATA[<p>FindPagesWithCriteria is a very handy way to pick up pages that are spread out around your site but there&#8217;s a tiny thing that is good to remember when using FindPagesWithCriteria to find pages based on a CustomProperites that you&#8217;ve made. Never ever forget to click &#8220;searchable property&#8221;  when you add the customproperty to your page. Why? Because if this is not checked, FindPagesWithCriteria won&#8217;t be able to find it, simple <img src='http://www.from-rizo.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Tiny post for a tiny problem that can cause a lot of headache <img src='http://www.from-rizo.se/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2010/04/28/using-findpageswithcriteria-with-customproperties/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to prevent EPiServer to inherit categories to childrenpages</title>
		<link>http://www.from-rizo.se/2010/01/14/how-to-prevent-episerver-to-inherit-categories-to-childrenpages/</link>
		<comments>http://www.from-rizo.se/2010/01/14/how-to-prevent-episerver-to-inherit-categories-to-childrenpages/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 14:33:16 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=394</guid>
		<description><![CDATA[<p>One of the pages I&#8217;ve been working on uses EPiServers categories a lot. But the annoying part with EPiServers categories is the way they inherit down to all children, which leads to the problem that categories can be deleted without someone meaning too. e.g you create a page called &#8220;Books&#8221; and you have a control [...]]]></description>
			<content:encoded><![CDATA[<p>One of the pages I&#8217;ve been working on uses EPiServers categories a lot. But the annoying part with EPiServers categories is the way they inherit down to all children, which leads to the problem that categories can be deleted without someone meaning too. e.g you create a page called &#8220;Books&#8221; and you have a control that creates a category using the pagename. Below &#8220;Books&#8221; you&#8217;ll add all the books you want, but all those books will get the category &#8220;books&#8221; aswell. But to prevent dead categories, you might want to make a check that once you delete a page, you&#8217;ll also delete the category. Then, when deleting a childpage, you&#8217;ll also delete the real category, since the childpage also had this category. There are of course ways to prevent this but this can easily be forgotten and cause future problems. It will also mess up search results that uses categories to find information and so on.</p>
<p>Enough with examples, let&#8217;s get on the easy solution.</p>
<pre class="brush: c#">

EPiServer.DataFactory.Instance.PublishingPage += CreateCategory;

EPiServer.DataFactory.Instance.SavedPage += CreateCategory;

EPiServer.DataFactory.Instance.SavingPage += CreateCategory;

EPiServer.DataFactory.Instance.CreatingPage += CreateCategory;

static void CreateCategory(object sender, EPiServer.PageEventArgs e)

{

if (!ValidPage(e.Page.PageTypeID))

{

e.Page.Property[&quot;PageCategory&quot;].Value = string.Empty;

}

}
</pre>
<p>Basicly, you&#8217;ll call the method &#8220;CreateCategory&#8221; whenever you create, save or publish a page. Then use a method to determinate if the pagetypeid of the page you are creating is a validpage (i.e you don&#8217;t want these pages to inherit categories) and then just give it a string.Emtpy as PageCategory value.  Whatever the situation, just make a method to check if you want the page to inherit the category or not, then use the code above.</p>
<p>Hope this helps</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">EPiServer.DataFactory.Instance.PublishingPage += Instance_SavingPage;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">EPiServer.DataFactory.Instance.SavedPage += Instance_SavingPage;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">EPiServer.DataFactory.Instance.SavingPage += Instance_SavingPage;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 75px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">EPiServer.DataFactory.Instance.CreatingPage += Instance_SavingPage;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2010/01/14/how-to-prevent-episerver-to-inherit-categories-to-childrenpages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 fix for Internet Explorer And Doctype fix for EPiServer solutions</title>
		<link>http://www.from-rizo.se/2009/10/08/html5-fix-for-internet-explorer-and-doctype-fix-for-episerver-solutions/</link>
		<comments>http://www.from-rizo.se/2009/10/08/html5-fix-for-internet-explorer-and-doctype-fix-for-episerver-solutions/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 07:47:06 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[doctype]]></category>
		<category><![CDATA[Episerver]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=380</guid>
		<description><![CDATA[<p>HTML 5 introduces new elements to use such as &#60;header&#62; &#60;section&#62; &#60;nav&#62; and many more. The problem is that no version of Internet Explorer recognizes the new elements, but Firefox, chrome and many others does. The solution is easy but a bit boring when you think about it, since it&#8217;s about replacing all new elements [...]]]></description>
			<content:encoded><![CDATA[<p>HTML 5 introduces <a title="HTML 5 Elements" href="http://simon.html5.org/html5-elements" target="_blank">new elements</a> to use such as &lt;header&gt; &lt;section&gt; &lt;nav&gt; and many more. The problem is that no version of Internet Explorer recognizes the new elements, but Firefox, chrome and many others does. The solution is easy but a bit boring when you think about it, since it&#8217;s about replacing all new elements to div instead. Which means that IE users won&#8217;t be able to appreciate HTML5 but users that use Firefox, Chrome and so on will.</p>
<p>Anyway, on with the solution! What you need to do is modify the writer and basically find all elements and change them with a div.  A good place to do it on is on your masterpage.</p>
<pre class="brush: c#">
protected override void Render(HtmlTextWriter writer)
{
if(Request.Browser.Browser == &quot;IE&quot;)
HTML5Replace(writer);
else
base.Render(writer);
}

private void HTML5Replace(HtmlTextWriter writer)
{
MemoryStream memoryStream = new MemoryStream();
StreamWriter streamWriter = new StreamWriter(memoryStream);
HtmlTextWriter memoryWriter = new HtmlTextWriter(streamWriter);
base.Render(memoryWriter);
memoryWriter.Flush();
memoryStream.Position = 0;
TextReader reader = new StreamReader(memoryStream);
string output = reader.ReadToEnd();
output = Regex.Replace(output, RegExStrings.HTML5_BLOCK_ELEMENTS , RegExStrings.HTML5_BLOCK_ELEMENTS_REPLACEMENT );
writer.Write(output);
}
</pre>
<p>But what REALLY does the magic is the RegEx, since it will find the elements for you and replace them correctly.</p>
<pre class="brush: c#">
public const string HTML5_BLOCK_ELEMENTS = @&quot;&lt;(\/)?(nav|section|header|aside|footer)&quot;;
public const string HTML5_BLOCK_ELEMENTS_REPLACEMENT = @&quot;&lt;$1div&quot;;
</pre>
<p>The reason why I use $1 on the replacement string, is because I want to add a &#8220;/&#8221; if there is one in the element I found. This to close the tag correctly. So basically, when it finds &#8220;&lt;nav&#8221; it will replace it with &#8220;&lt;div&#8221; and when it finds &#8220;&lt;/nav&#8221; it will replace it with &#8220;&lt;/div&#8221;. Closing tag and class/id names will still be there so the div can take on the behavior of the replaced element.</p>
<p>Another problem that you will run into, if you&#8217;re running your site with EPiServer that is, is that EPiServers friendlyurlrewriter doesn&#8217;t recognize the doctype and it will try to fix it for you. For HTML 5 you&#8217;ll need the following doctype  &#8221;&lt;!DOCTYPE html&gt;&#8221; but EPiServer will change it to the following &#8220;&lt;!DOCTYPE HTML PUBLIC &#8220;&#8221; &#8220;&#8221;&gt;&#8221;. Mohsen Pirouzfar found a great solution for this which you can <a title="Doctype fix for EPIServer" href="http://www.pirouzfar.se/index.php?option=com_content&amp;view=article&amp;id=77:fixa-till-doctype-foer-html5-i-episerver&amp;catid=34" target="_blank">read here</a>. It&#8217;s in swedish but the code itself is usable to anyone <img src='http://www.from-rizo.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2009/10/08/html5-fix-for-internet-explorer-and-doctype-fix-for-episerver-solutions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sidan är inte tillgänglig för aktuellt språk / This page is not available for the active language &#8211; EPiServer5 Upgrade to SP2</title>
		<link>http://www.from-rizo.se/2009/09/11/sidan-ar-inte-tillganglig-for-aktuellt-sprak-this-page-is-not-available-for-the-active-language-episerver5-upgrade-to-sp2/</link>
		<comments>http://www.from-rizo.se/2009/09/11/sidan-ar-inte-tillganglig-for-aktuellt-sprak-this-page-is-not-available-for-the-active-language-episerver5-upgrade-to-sp2/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 08:07:51 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[Episerver]]></category>
		<category><![CDATA[Language]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=373</guid>
		<description><![CDATA[<p>After upgrading EPiServer CMS5 r2 to CMS5 r2sp2 you might get a nice little error in edit mode. This page is not available for the active language. This is due globalization changes and the workaround is to activate a language for your site. To do this do the following:</p>
<p>1. Go to admin mode
2. Click on [...]]]></description>
			<content:encoded><![CDATA[<p>After upgrading EPiServer CMS5 r2 to CMS5 r2sp2 you might get a nice little error in edit mode. This page is not available for the active language. This is due globalization changes and the workaround is to activate a language for your site. To do this do the following:</p>
<p>1. Go to admin mode<br />
2. Click on Config<br />
3. Go to systemsettings<br />
4. Activate Globalization<br />
5. Go to Edit mode<br />
6. click on Language Settings<br />
7. Chose the default language<br />
8. Go back to admin mode<br />
9. Turn off globalization</p>
<p>This should do the trick. Remeber, if you have several sites, you need to click on the root of each one of them and set the language settings on all of them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2009/09/11/sidan-ar-inte-tillganglig-for-aktuellt-sprak-this-page-is-not-available-for-the-active-language-episerver5-upgrade-to-sp2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2008 System Runtime InteropServices COMException</title>
		<link>http://www.from-rizo.se/2009/09/07/visual-studio-2008-system-runtime-interopservices-comexception/</link>
		<comments>http://www.from-rizo.se/2009/09/07/visual-studio-2008-system-runtime-interopservices-comexception/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 12:03:20 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=369</guid>
		<description><![CDATA[<p>I had to make a clean Vista install on my machine and all of a sudden I was getting System.Runtime.InteropServices.COMException when opening old solutions. The error says very little to the user but what it really want&#8217;s to say is:</p>
<p>Install IIS 6 WMI Compatibility by going to Control Panel, Programs, Turn windows features on and [...]]]></description>
			<content:encoded><![CDATA[<p>I had to make a clean Vista install on my machine and all of a sudden I was getting System.Runtime.InteropServices.COMException when opening old solutions. The error says very little to the user but what it really want&#8217;s to say is:</p>
<p>Install IIS 6 WMI Compatibility by going to Control Panel, Programs, Turn windows features on and off and select as the picture below shows<a href="http://www.from-rizo.se/wp-content/upLoads/2009/09/windowsfeatures.jpg" rel="lightbox[369]"><img class="alignnone size-medium wp-image-370" title="windowsfeatures" src="http://www.from-rizo.se/wp-content/upLoads/2009/09/windowsfeatures-300x261.jpg" alt="windowsfeatures" width="300" height="261" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2009/09/07/visual-studio-2008-system-runtime-interopservices-comexception/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>EPiServer CMS5 Softlinks. How to find a documents linking pages</title>
		<link>http://www.from-rizo.se/2009/06/25/episerver-cms5-softlinks-how-to-find-a-documents-linking-pages/</link>
		<comments>http://www.from-rizo.se/2009/06/25/episerver-cms5-softlinks-how-to-find-a-documents-linking-pages/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 10:24:00 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[Episerver]]></category>
		<category><![CDATA[Linking Pages]]></category>
		<category><![CDATA[Softlinks]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=361</guid>
		<description><![CDATA[<p>Using EPiServers softlink can really come in handy in different situations.  Mostly of course when you need to gather information from the linked pages of a document.</p>
<p>Here&#8217;s an example on how to use this:</p>
<p>Example in VB.Net</p>


Dim f As EPiServer.Web.Hosting.UnifiedFile = TryCast(System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(filename), EPiServer.Web.Hosting.UnifiedFile)

Dim filecollection As EPiServer.DataAbstraction.SoftLinkCollection = EPiServer.DataAbstraction.SoftLink.Load(f)

For Each file As EPiServer.DataAbstraction.SoftLink In filecollection
Dim ref As [...]]]></description>
			<content:encoded><![CDATA[<p>Using EPiServers softlink can really come in handy in different situations.  Mostly of course when you need to gather information from the linked pages of a document.</p>
<p>Here&#8217;s an example on how to use this:</p>
<p>Example in VB.Net</p>
<pre class="brush: vb.net">

Dim f As EPiServer.Web.Hosting.UnifiedFile = TryCast(System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(filename), EPiServer.Web.Hosting.UnifiedFile)

Dim filecollection As EPiServer.DataAbstraction.SoftLinkCollection = EPiServer.DataAbstraction.SoftLink.Load(f)

For Each file As EPiServer.DataAbstraction.SoftLink In filecollection
Dim ref As New PageReference
ref = file.OwnerPageLink
&#039;now you can work your magic
Next
</pre>
<p>Example in C#:</p>
<pre class="brush: c#">

EPiServer.Web.Hosting.UnifiedFile f = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile(filename) as EPiServer.Web.Hosting.UnifiedFile;

EPiServer.DataAbstraction.SoftLinkCollection filecollection = EPiServer.DataAbstraction.SoftLink.Load(f);

foreach (EPiServer.DataAbstraction.SoftLink file in filecollection) {
PageReference ref = new PageReference();
ref = file.OwnerPageLink;
//now you can work your magic
}
</pre>
<p>So what you need to do is pretty much to load up the file reference into a softlink and fill a softlinkcollection with that. Then just run a for each on the collection (since a document can have several linking pages). Once you get your reference, you can just do a getpage on the ref and grab whatever you need from the linking page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2009/06/25/episerver-cms5-softlinks-how-to-find-a-documents-linking-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>* % &amp; : Special Characters in URL and files causing HTTP 400 Bad Request</title>
		<link>http://www.from-rizo.se/2009/05/27/special-characters-in-url-and-files-causing-http-400-bad-request/</link>
		<comments>http://www.from-rizo.se/2009/05/27/special-characters-in-url-and-files-causing-http-400-bad-request/#comments</comments>
		<pubDate>Wed, 27 May 2009 15:02:31 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[Bad Request]]></category>
		<category><![CDATA[HTTP 400]]></category>
		<category><![CDATA[Special Character]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=352</guid>
		<description><![CDATA[<p>One of our customers have a lot of PDF that are linked to their site. Some of these PDF files have % in the filename and this causes a HTTP 400 Bad Request and yes they are encoded correctly. The same error happened with other characters such &#38;, * and :</p>
<p>Finally, the solution was found [...]]]></description>
			<content:encoded><![CDATA[<p>One of our customers have a lot of PDF that are linked to their site. Some of these PDF files have % in the filename and this causes a HTTP 400 Bad Request and yes they are encoded correctly. The same error happened with other characters such &amp;, * and :</p>
<p>Finally, the solution was found @ dirk.net with an article regarding 400 bad request in IIS7 (But IIS6 also has the same problem and the solution will work there too). You can read about it <a href="http://dirk.net/2008/06/09/ampersand-the-request-url-in-iis7/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2009/05/27/special-characters-in-url-and-files-causing-http-400-bad-request/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL converting datetime to shortdate</title>
		<link>http://www.from-rizo.se/2009/04/20/sql-converting-datetime-to-shortdate/</link>
		<comments>http://www.from-rizo.se/2009/04/20/sql-converting-datetime-to-shortdate/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 13:25:48 +0000</pubDate>
		<dc:creator>Rizo</dc:creator>
				<category><![CDATA[Developing]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.from-rizo.se/?p=349</guid>
		<description><![CDATA[<p>I&#8217;ve a table where I need to select the posts with the latest date. Problem is that when you get the latest date it also gets it by the hour, meaning that it will try to fetch everything older or equal to the date + time, which is nothing. There for, I need to make [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve a table where I need to select the posts with the latest date. Problem is that when you get the latest date it also gets it by the hour, meaning that it will try to fetch everything older or equal to the date + time, which is nothing. There for, I need to make it a shortdate so I can fetch everything that was posted on that day.</p>
<p>The following code will set the variabel to the latest date on the table.</p>
<pre class="brush: sql">
DECLARE @latestDate as datetime
SET @latestDate = (SELECT postDate from table where postDate = (Select max(postDate) from table))
</pre>
<p><strong>This will return Jan 20 2009  6:45PM</strong></p>
<p>Then all I need to add to my SELECT is</p>
<pre class="brush: sql">
CONVERT(VARCHAR(10), @latestDate, 101)
</pre>
<p><strong>This will return 01/20/2009</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.from-rizo.se/2009/04/20/sql-converting-datetime-to-shortdate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
