title: Export data to Excel in Webmatrix
body: <p>I want to be able to export the results of a query into excel by someone pressing a button that says export to excel. The following picture shows an example:
  <img src="https://i.stack.imgur.com/jmzgO.png" alt="enter image description here"></p>
  
  <p>I have looked at this <a href="http://www.codeproject.com/Tips/477436/Export-Gridview-Data-to-Excel-in-ASP-NET" rel="nofollow noreferrer">WEBSITE</a> which does what I would like to have on my website. The problem is that I have only worked in .cshtml pages and I am really unfamiliar with the process of where to put the codes on that website or what page extensions they should be. Can someone please guide me?</p>