title: Can't download .cs file
body: <p>I was wondering if someone can tell me why I can't make a link so a person can download a custom .cs file?</p>
  
  <pre><code>&lt;a href="~/File/Tools.cs" download="" target="_blank"&gt;Download&lt;/a&gt;
  </code></pre>
  
  <p>This is how I create the file (part of the code):</p>
  
  <pre><code>string pathString = Server.MapPath("~/File/");
  string fileName = "Tools.cs";
  pathString = System.IO.Path.Combine(pathString, fileName);
  ...
  System.IO.File.Create(pathString).Dispose();
  TextWriter tw = new StreamWriter(pathString);
  tw.WriteLine("using System;");
  tw.WriteLine("using System.Collections.Generic;");
  tw.WriteLine("using System.Linq;");
  tw.WriteLine("using System.Web;");
  ...
  </code></pre>
  
  <p>If I look in the folder the file is there and it works. But I just can't download it.</p>
  
  <p>Any idea why?</p>