title: How to export a gridview to csv file on disc?
body: <p>I've an export button to export gridview to excel file on disk. However, I want to export it -<strong>without any dialog</strong>- to csv file <strong>on disk</strong>, too. How can I do this?</p>
  
  <pre><code>        var sw = new StringWriter();
          var htw = new HtmlTextWriter(sw);
  
          // Render grid view control.
          grd.RenderControl(htw);
  
          // Write the rendered content to a file.
          string renderedGridView = sw.ToString();
          File.WriteAllText(@"C:\Sheets\" + "_Orders.xls", renderedGridView);
  </code></pre>