title: running razor code in html file
body: <p>I'm working on on a phonegap application.  I'm using an asp.net project to do my development in and then I am compiling all my files to static html files for the phonegap app.  </p>
  
  <p>I want to take advantage of razor syntax for things like including files and simple logic.  </p>
  
  <p>Is there a way to run razor code in an html file?  </p>
  
  <p>I am currently using cshtml files, but PhoneGap will only accept html files.  I currently have RazorEngine to compile the cshtml files to html files, but then I also need to update every link from .cshtml to .html and things are getting complicated.</p>
  
  <p>Code example for razor templating...</p>
  
  <pre><code>@using System.IO;
  @using RazorEngine;
  
  @{  // render panelhtml and header html once, and then print it out below in each page
      string panelHtml = Razor.Parse(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "/Views/Shared/_Panel.cshtml"));  
      string headerHtml = Razor.Parse(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "/Views/Shared/_HeaderLoggedIn.cshtml"));  
      string topHtml = Razor.Parse(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "/Views/Shared/_HeaderLoggedIn.cshtml"));
  
      WriteLiteral(topHtml);          
  }
  
  &lt;!-- pageDebug --&gt;
      &lt;div data-role="page" id="pageDebug"  data-add-back-btn="true"&gt;
  
          @{  WriteLiteral(panelHtml);  }
  
          @{  WriteLiteral(headerHtml);  }
  </code></pre>