<?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>matthewkenny.com &#187; asp.net</title>
	<atom:link href="http://www.matthewkenny.com/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matthewkenny.com</link>
	<description></description>
	<lastBuildDate>Sun, 20 Dec 2009 23:10:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Setting Sitecore ImageField</title>
		<link>http://www.matthewkenny.com/2009/12/setting-sitecore-imagefield/</link>
		<comments>http://www.matthewkenny.com/2009/12/setting-sitecore-imagefield/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 23:10:28 +0000</pubDate>
		<dc:creator>Matthew Kenny</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[sitecore]]></category>

		<guid isPermaLink="false">http://www.matthewkenny.com/?p=106</guid>
		<description><![CDATA[Recently I had to write something to allow users to upload their own content on a Sitecore site. Not an unusual, or especially difficult, piece of functionality but one thing that did give me a bit of trouble was associating uploaded images (in the media library with the Sitecore item&#8217;s image field. Originally I tried [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to write something to allow users to upload their own content on a Sitecore site.  Not an unusual, or especially difficult, piece of functionality but one thing that did give me a bit of trouble was associating uploaded images (in the media library with the Sitecore item&#8217;s image field.<span id="more-106"></span></p>
<p>Originally I tried setting the media ID and the media path properties, but that didn&#8217;t quite work.  Eventually I found that you have to set the media ID, media path, source, and a custom attribute (&#8220;<tt>showineditor</tt>&#8220;).  I was surprised that it wasn&#8217;t easier to assign a media file to an <tt>ImageField</tt> object, but that&#8217;s easily resolved using extension methods introduced in .Net 3.5.  For the lazier among us, I&#8217;ve included a small snippet of code that does the important stuff.  This code is written for Sitecore 5.3, but should work on Sitecore 6.x with minor tweaking if some nicer methods haven&#8217;t already been put in place.  Obviously, production code should be made a bit robust than what&#8217;s below, which has no exception handling and <em>assumes the item is already in editing mode</em>.</p>
<pre name="code" class="c-sharp">
public void AssignMediaItem(ImageField field, Item mediaItem)
{
    field.MediaID = mediaItem.ID;
    MediaUrlOptions options = new MediaUrlOptions();
    field.Src = MediaManager.GetMediaUrl(mediaItem, options);
    field.MediaPath = mediaItem.Paths.MediaPath;
    field.SetAttribute("showineditor", "1");
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewkenny.com/2009/12/setting-sitecore-imagefield/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sitecore v6.0</title>
		<link>http://www.matthewkenny.com/2009/06/sitecore-v6-0/</link>
		<comments>http://www.matthewkenny.com/2009/06/sitecore-v6-0/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 17:40:42 +0000</pubDate>
		<dc:creator>Matthew Kenny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[bit10]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[scd]]></category>
		<category><![CDATA[sitecore]]></category>

		<guid isPermaLink="false">http://www.matthewkenny.com/?p=81</guid>
		<description><![CDATA[Yesterday I took my &#8220;upgrade&#8221; certification exam to upgrade my Sitecore 5.3 certification that I obtained last August to to the recently released version 6.0. Sitecore is a highly adaptable and extremely powerful CMS that bit10 chose as its CMS of choice.  After reviewing a fair number of competing offerings (including Amaxus and Ektron), we [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I took my &#8220;upgrade&#8221; certification exam to upgrade my Sitecore 5.3 certification that I obtained last August to to the recently released version 6.0.  <a title="Sitecore website" href="http://www.sitecore.net" target="_blank">Sitecore</a> is a highly adaptable and extremely powerful CMS that bit10 chose as its CMS of choice.  After reviewing a fair number of competing offerings (including Amaxus and Ektron), we found Sitecore to be a superior offering.<span id="more-81"></span></p>
<p>Version 6 brings some excellent new features to the table; some which have been present in many other CMS products and others which are pretty unique.  I&#8217;m looking forward to working with it in July/August, which is when I&#8217;ve been scheduled to redevelop the <a title="bit10 website" href="http://www.bit10.net/" target="_blank">bit10</a> website (the final designs for which have been described as &#8220;funky but clean&#8221;).  We&#8217;ll see how it goes; expect to hear more on the topic of Sitecore when the project is done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewkenny.com/2009/06/sitecore-v6-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC Framework &#8211; Initial Thoughts</title>
		<link>http://www.matthewkenny.com/2009/06/asp-net-mvc-framework-initial-thoughts/</link>
		<comments>http://www.matthewkenny.com/2009/06/asp-net-mvc-framework-initial-thoughts/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 11:24:11 +0000</pubDate>
		<dc:creator>Matthew Kenny</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.matthewkenny.com/?p=68</guid>
		<description><![CDATA[Having just completed a relatively large project using the newly released ASP.Net MVC Framework, I thought this would be a good time to post my thoughts on the framework.  I have to say that the bulk of my experience with MVC framework comes from my time using Ruby on Rails, so many of my perceptions [...]]]></description>
			<content:encoded><![CDATA[<p>Having just completed a relatively large project using the newly released ASP.Net MVC Framework, I thought this would be a good time to post my thoughts on the framework.  I have to say that the bulk of my experience with MVC framework comes from my time using Ruby on Rails, so many of my perceptions will be coloured by this.<span id="more-68"></span></p>
<p>First of all, for anyone who isn&#8217;t familiar with MVC (or Model View Controller), it&#8217;s a design pattern that emphasises the separation of concerns within the application, essentially: presentation data is kept separate from the application data, which &#8211; in turn &#8211; is separated from the logic relating to data storage, manipulation and retrieval.  The result is &#8211; for the most part &#8211; an application that is surprisingly easy to maintain and adapt.</p>
<p>The idea is to have a controller class, which exposes several public methods &#8211; or, actions &#8211; which can be called by a web request.  These actions execute a task, often involving communication with data storage through the model layer, and then finally pass data to a view, which renders the data and returns that to the user.  Some actions may have filters that run at various stages in the request, and can alter the end result of the request (a common example is to ensure a user is authenticated before processing an action).</p>
<p>For the most part, I have been pleased with the ASP.Net MVC Framework.  It bears striking resemblances in many places to Ruby on Rails, however it is often apparent that the framework is in its early stages as it is not as polished as Ruby on Rails.</p>
<p>Filters were one thing that irritated me somewhat, however they also had some features that I thought were original.  First, I thought that the usage of filters was cumbersome and quite inelegant: filters can be placed either on an action or an all actions in a controller class by decorating the method or class with the appropriate filter attribute.  The result of this method is that your controllers can become a hodgepodge of filter attributes.  I wish I had the syntactic sugar of Ruby on Rails&#8217; <tt>before_filter</tt> function, where it&#8217;s possible to write:</p>
<blockquote><p><tt>before_filter :require_admin, :only =&gt; [:delete, :create, :edit]</tt><br />
<tt>before_filter :require_logged_in, :except =&gt; [:login, :register]</tt></p></blockquote>
<p>I think that something based on the above would be a much neater way of specifying filters.</p>
<p>I liked having access to the &#8220;request context&#8221; from all the main parts of the application.  It serves as a rather straight-forward method of passing data between the layers and of accessing the original request information.  Something that can be difficult to do when you get deep into Rails applications: you lose the context of the request; you can&#8217;t get the original controller action or other request data.</p>
<p>I thought that the approach of using the <tt>ActionResult</tt> type to offload the work of processing each type of result was an excellent idea.  It actually neatly avoids a common source of errors encountered during the development or Rails applications: the &#8220;double render&#8221; error.  This error happens when, for example, a redirect is issued but then the controller continues to issue a view result also (caused because Ruby on Rails controller functions responsible for issuing results do not cause the controller action to return).  Returning the <tt>ActionResult </tt>neatly avoids that issue.</p>
<p>Initially I took great issue with the typical method of passing data into views via the <tt>ViewData</tt> dictionary.  I didn&#8217;t like the lack of strong-typing, the messiness this introduced into the view code, nor the ease with which certain things could be omitted from the dictionary.  I&#8217;m aware that the first and last really also apply to Ruby on Rails: the first I can ignore because Ruby, unlike C#, is dynamically typed; the second however, remains equally valid.  I would like to have some sort of contract between the View and the Controller that specified what data will be supplied, although I&#8217;m aware this is heading more toward the MCP design pattern.</p>
<p>Shortly after my disappointment over the <tt>ViewData</tt> dictionary, I discovered the existence of page models.  The ASP.Net MVC framework allows you to create strongly typed views by use of a page model (in most cases, a class that exposes a number of properties containing information that would normally be passed via the <tt>ViewData</tt>.  It doesn&#8217;t allow you to <em>require </em>values to be passed into the view, but it&#8217;s much better than the alternative.</p>
<p>Then finally we have the Model Binding of the ASP.Net Framework.  This is still a bit of a black art to me; I&#8217;ve not yet had time to sufficiently examine its workings, but it is rather nifty.  It enables the binding of values to objects in the controller and views; this allows controller actions to use model objects (<em>e.g.</em> a user object) as a parameter rather than having a parameter for each field of the user.  It also allows &#8220;sticky fields&#8221; to be implemented very easily in the View.</p>
<p>That&#8217;s all that&#8217;s come to mind right now &#8211; although I&#8217;m certainly sure there are other things that I&#8217;ve overlooked.  You may notice that I&#8217;ve omitted practically any reference to the Model part of MVC; this isn&#8217;t a co-incidence, it&#8217;s an avenue that I&#8217;m leaving open to the possibility of future posts given the fact that the ASP.Net MVC framework does not tie you to one particular ORM like Ruby on Rails does (generally speaking).  It would make the scope of the post far too large, and I feel that this post is pushing the bounds of length regardless.</p>
<p>Anyway, these are my thoughts; if anyone has some other views, contributions or corrections, I look forward to reading them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewkenny.com/2009/06/asp-net-mvc-framework-initial-thoughts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Matt Gets Certified</title>
		<link>http://www.matthewkenny.com/2008/09/matt-gets-certified/</link>
		<comments>http://www.matthewkenny.com/2008/09/matt-gets-certified/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 19:10:27 +0000</pubDate>
		<dc:creator>Matthew Kenny</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[sitecore]]></category>

		<guid isPermaLink="false">http://www.matthewkenny.com/?p=31</guid>
		<description><![CDATA[Being my first &#8220;official&#8221; certification, I figured I&#8217;d give it a mention.  A couple of weeks ago I got sent down to London to do some developer training for a CMS that we&#8217;re going to be using quite a bit at the company I work at.  At some point, there&#8217;s also going to be some [...]]]></description>
			<content:encoded><![CDATA[<p>Being my first &#8220;official&#8221; certification, I figured I&#8217;d give it a mention.  A couple of weeks ago I got sent down to London to do some developer training for a <abbr title="Content Management System">CMS</abbr> that we&#8217;re going to be using quite a bit at the company I work at.  At some point, there&#8217;s also going to be some interesting work porting existing customer sites to the <a title="Sitecore website" href="http://www.sitecore.net" target="_blank">Sitecore</a> platform.<br />
<span id="more-31"></span><br />
In the meantime, there&#8217;s one large Sitecore project which I&#8217;m due to start development on in coming weeks; so I&#8217;m looking forward to doing some actual work with it.</p>
<p>I think I might start looking at some proper accreditations in the near future, as they can only help my career prospects, and I think they&#8217;d really be quite interesting.  The question is whether I&#8217;ll have to cough up the money myself or if it will be covered under CPD&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matthewkenny.com/2008/09/matt-gets-certified/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
