title: Run MVC controller action without the view?
body: <p>I have an ExcelResult action result that returns Microsoft Excel documents, based off the <a href="http://stephenwalther.com/blog/archive/2008/06/16/asp-net-mvc-tip-2-create-a-custom-action-result-that-returns-microsoft-excel-documents.aspx" rel="noreferrer">Stephen Walther tip</a>.  Basically it just writes a stream out to the Response.  When debugging VS 2010 (ASP.NET Dev Server), it runs fine, but when I run it on an IIS 6 box, I get the following error:</p>
  
  <blockquote>
    <p>The view 'GenerateExcel' or its master was not found. The following locations were searched:
    ~/Views/Home/GenerateExcel.aspx
    ~/Views/Home/GenerateExcel.ascx
    ~/Views/Shared/GenerateExcel.aspx
    ~/Views/Shared/GenerateExcel.ascx </p>
  </blockquote>
  
  <p>There is no associated View, and therefore no file, but there shouldn't have to be.  What am I doing wrong?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>By simply returning void instead of an ActionResult, I no longer have this issue.  Instead of returning the ExcelResult, I'm explicitly calling it's ExecuteResult method, which is writing to the output stream.</p>
  
  <p><strong>Before</strong></p>
  
  <pre><code>public ActionResult GenerateExcel()
  {
      return this.Excel(parameters);
  }
  </code></pre>
  
  <p><strong>After</strong></p>
  
  <pre><code>    public void GenerateExcel()
  {
  ExcelResult excelResult = this.Excel(parameters);
  excelResult.ExecuteResult(null);
  }
  </code></pre>
  
  <p>After that, I had security issues with my NTLM authentication, but they 'went away' (meaning I expect them to come back).  For now, though, everything is working properly.</p>