title: generate and download csv file by passing parameters to controller method in C# MVC
body: <p>I have a method GenerateCSV(string accountNumber, string dt1, string dt2) in my ReportController</p>
  
  <p>How do i initiate this request from my Report.cshtml?</p>
  
  <pre><code> &lt;h2&gt;Settled Report&lt;/h2&gt;&lt;br /&gt;
      @using (Html.BeginForm("Report", "ReportController", FormMethod.Get))
      {
          &lt;p&gt;
              Accounts: @Html.DropDownList("accountNumber")
              Start Date: @Html.TextBox("dt1", null, new { @class = "date-picker" })
              End Date: @Html.TextBox("dt2", null, new { @class = "date-picker" })
              @*@Html.Hidden("reportType", 1)*@
              &lt;input type="hidden" id="" value="1" name="reportType" /&gt;
              &lt;input type="submit" value="View Report" /&gt;
          &lt;/p&gt;
          &lt;div class="exportbuttons"&gt;
              @Html.ActionLink("Export to CSV", "GenerateCSV")
          &lt;/div&gt;
      }
  </code></pre>
  
  <p>The <em>GenerateCSV</em> is called but all params are null, and the server tries to navigate to <em>Report/GenerateCSV</em></p>