<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: ContentType route constraint in ASP.NET MVC</title>
	<atom:link href="http://www.dan-atkinson.com/blog/index.php/104/contenttype-route-constraint-in-asp-net-mvc/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dan-atkinson.com/blog/index.php/104/contenttype-route-constraint-in-asp-net-mvc</link>
	<description>Where Code And Design Meet</description>
	<lastBuildDate>Tue, 02 Feb 2010 12:57:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dan</title>
		<link>http://www.dan-atkinson.com/blog/index.php/104/contenttype-route-constraint-in-asp-net-mvc/comment-page-1#comment-169</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 02 Feb 2010 12:57:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.dan-atkinson.com/blog/?p=104#comment-169</guid>
		<description>Yes, that&#039;s certainly another way of doing it that I hadn&#039;t thought of! I will look to including this as a way of doing it in a new version. If you have a website, please can you send me the url so I can give you credit?

Thanks!</description>
		<content:encoded><![CDATA[<p>Yes, that&#8217;s certainly another way of doing it that I hadn&#8217;t thought of! I will look to including this as a way of doing it in a new version. If you have a website, please can you send me the url so I can give you credit?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hightechrider</title>
		<link>http://www.dan-atkinson.com/blog/index.php/104/contenttype-route-constraint-in-asp-net-mvc/comment-page-1#comment-166</link>
		<dc:creator>Hightechrider</dc:creator>
		<pubDate>Mon, 01 Feb 2010 04:13:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.dan-atkinson.com/blog/?p=104#comment-166</guid>
		<description>Why use reflection and Enum&#039;s when a simple class would suffice?  Maybe something like ...

&lt;code&gt;
public class ContentTypeConstraint : IRouteConstraint
{
  private string contentType;
  private ContentTypeConstraint() {}

  public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
  {
    if (routeDirection == RouteDirection.UrlGeneration)
      return true;
      return httpContext.Request.ContentType == this.contentType;
  }

  public static readonly ContentTypeConstraint Xml = new ContentTypeConstraint() { contentType = &quot;text/xml&quot; };
  public static readonly ContentTypeConstraint Json = new ContentTypeConstraint() { contentType = &quot;application/json&quot; };
  public static readonly ContentTypeConstraint Html = new ContentTypeConstraint() { contentType = &quot;text/html&quot; };
  }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Why use reflection and Enum&#8217;s when a simple class would suffice?  Maybe something like &#8230;</p>
<p><code><br />
public class ContentTypeConstraint : IRouteConstraint<br />
{<br />
  private string contentType;<br />
  private ContentTypeConstraint() {}</p>
<p>  public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)<br />
  {<br />
    if (routeDirection == RouteDirection.UrlGeneration)<br />
      return true;<br />
      return httpContext.Request.ContentType == this.contentType;<br />
  }</p>
<p>  public static readonly ContentTypeConstraint Xml = new ContentTypeConstraint() { contentType = "text/xml" };<br />
  public static readonly ContentTypeConstraint Json = new ContentTypeConstraint() { contentType = "application/json" };<br />
  public static readonly ContentTypeConstraint Html = new ContentTypeConstraint() { contentType = "text/html" };<br />
  }<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention ContentType route constraint in ASP.NET MVC &#124; Dan Atkinson -- Topsy.com</title>
		<link>http://www.dan-atkinson.com/blog/index.php/104/contenttype-route-constraint-in-asp-net-mvc/comment-page-1#comment-165</link>
		<dc:creator>Tweets that mention ContentType route constraint in ASP.NET MVC &#124; Dan Atkinson -- Topsy.com</dc:creator>
		<pubDate>Sat, 30 Jan 2010 22:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.dan-atkinson.com/blog/?p=104#comment-165</guid>
		<description>[...] This post was mentioned on Twitter by Elijah Manor, George Chatzimanolis, SynteZZZ, SynteZZZ, OryxDEV.NET and others. OryxDEV.NET said: RT @ScottGu: Useful tip RT &quot;ContentType route constraint in ASP.NET MVC&quot; by @danbo http://j.mp/aKjEk6 (via @elijahmanor) [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Elijah Manor, George Chatzimanolis, SynteZZZ, SynteZZZ, OryxDEV.NET and others. OryxDEV.NET said: RT @ScottGu: Useful tip RT &quot;ContentType route constraint in ASP.NET MVC&quot; by @danbo <a href="http://j.mp/aKjEk6" rel="nofollow">http://j.mp/aKjEk6</a> (via @elijahmanor) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uberVU - social comments</title>
		<link>http://www.dan-atkinson.com/blog/index.php/104/contenttype-route-constraint-in-asp-net-mvc/comment-page-1#comment-164</link>
		<dc:creator>uberVU - social comments</dc:creator>
		<pubDate>Sat, 30 Jan 2010 11:41:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.dan-atkinson.com/blog/?p=104#comment-164</guid>
		<description>&lt;strong&gt;Social comments and analytics for this post...&lt;/strong&gt;

This post was mentioned on Twitter by Danbo: New blog post: ContentType route constraint in ASP.NET MVC http://bit.ly/blb4xr...</description>
		<content:encoded><![CDATA[<p><strong>Social comments and analytics for this post&#8230;</strong></p>
<p>This post was mentioned on Twitter by Danbo: New blog post: ContentType route constraint in ASP.NET MVC <a href="http://bit.ly/blb4xr.." rel="nofollow">http://bit.ly/blb4xr..</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ASP.NET MVC Archived Buzz, Page 1</title>
		<link>http://www.dan-atkinson.com/blog/index.php/104/contenttype-route-constraint-in-asp-net-mvc/comment-page-1#comment-162</link>
		<dc:creator>ASP.NET MVC Archived Buzz, Page 1</dc:creator>
		<pubDate>Fri, 29 Jan 2010 03:04:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.dan-atkinson.com/blog/?p=104#comment-162</guid>
		<description>[...] to Vote[FriendFeed] ContentType route constraint in ASP.NET MVC (1/28/2010)Thursday, January 28, 2010 from [...]</description>
		<content:encoded><![CDATA[<p>[...] to Vote[FriendFeed] ContentType route constraint in ASP.NET MVC (1/28/2010)Thursday, January 28, 2010 from [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->