title: How I can validate urls in C# for localhost
body: <p>I am using UrlAttribute in MVC </p>
  
  <p>but its not accepting the localhost urls e.g <a href="http://localhost/GCWeb" rel="noreferrer">http://localhost/GCWeb</a></p>
  
  <pre><code>[Url(ErrorMessage = "please_enter_valid_ftp_url", ErrorMessage = null)] 
  public string Url { get; set; }
  </code></pre>
  
  <p>This validates the urls but not for localhost urls.</p>
  
  <p>How can I do this?</p>