title: Converting a web address to a valid href value
body: <p>Firstly, this seems like something that should have been asked before, but I cannot find anything that answers my question.</p>
  
  <p>A basic overview of my task is to render an anchor link on a web page which is based on a user defined web address. As the address is user defined this could be in any format, for example:</p>
  
  <ul>
  <li><a href="http://www.example.com" rel="nofollow">http://www.example.com</a></li>
  <li><a href="https://www.example.com" rel="nofollow">https://www.example.com</a></li>
  <li>www.example.com</li>
  <li>example.com</li>
  </ul>
  
  <p>What I need to do with this value is to set it as the <code>href</code> property of an anchor tag. Now, the problem is that (in Chrome at least) only the first two examples will work due to the fact they are recognised as absolute URL paths. The last two examples will redirect to the same domain (i.e. treated as relative paths)</p>
  
  <p>So the ultimate question is: What is the best way to format these values to ensure a consistent absolute path is used? I could check for http/https and add it if missing, but I was hoping there might be an out of the box .Net class that would be more reliable.</p>
  
  <p>In addition, as this is a user defined value, it could be complete junk anyway so a function to validate the URL would be a nice bonus too.</p>