title: Should I store spaces in my URLs in the database? If so, how do I encode them when putting them into <a href="...">?
body: <p>In my blog, I store URIs on entities to allow them be customised (and friendly). Originally, they could contain spaces (eg. "/tags/ASP.NET MVC"), but the W3C validation says spaces are not valid.</p>
  
  <p>The <code>System.Uri</code> class takes spaces, and seems to encode them as I want (eg. <code>/tags/ASP.NET MVC</code> becomes <code>/tags/ASP.NET%20MVC</code>), but I don't want to create a <code>Uri</code> just to throw it away, this feels dirty!</p>
  
  <p><strong>Note: None of <code>Html.Encode</code>, <code>Html.AttributeEncode</code> and <code>Url.Encode</code> will encode <code>"/tags/ASP.NET MVC"</code> to <code>"/tags/ASP.NET%20MVC"</code>.</strong></p>
  
  <hr>
  
  <p><strong>Edit:</strong> I edited the <code>DataType</code> part out of my question as it turns out DataType does not directly provide any validation, and there's no built-in URI validation. I found some extra validators at <a href="http://dataannotationsextensions.org/" rel="nofollow">dataannotationsextensions.org</a> but it only supports absolute URIs and it looks like spaces my be valid there too.</p>