title: MVC Serve audio files while preventing direct linking using HttpResponseBase
body: <p>I need to be able to serve audio files to an mvc app while preventing direct access.  Ideally the page would render with a player control so the user can start/stop the audio linked to the database record (audio files are in a folder not the db).  I have a controller action like this:</p>
  
  <pre><code>        Response.Clear();
          Response.ContentType = "audio/wav";
          Response.TransmitFile(audioFilename);
          Response.End();
          return Response;
  </code></pre>
  
  <p>and the view uses the RenderAction method</p>
  
  <pre><code>&lt;% Html.RenderAction("ServeAudioFile"); %&gt;
  </code></pre>
  
  <p>this works but it won't display inline on the existing view, it opens a new page with just the media control.  Am I totally barking up the wrong tree or is there a way to embed the response in the existing view?   works exactly as I would like but I can't control access to the file.  </p>