I want to pass two parameters in @Url.Action.
View:
 <select id="ddlSearchBy" name="ddlSearchBy" style="width: 150px">
      <option value="TaxCode">Tax Code</option>
      <option value="TaxDescription">Tax Description</option>
      <option value="ClassDescription">Class Description</option>
      <option value="ZoneName">Zone Name</option>
  </select>
  <input type="text" name="txtSearchValue" id="txtSearchValue"/>
  <button type="button" id="btnDownload">Download</button>
  <button type="button" id="btnSearch">Search</button>
On Download button click, I am calling the method "ExportToExcel" in Masters Controller and also I need to pass two parameters. i.e. the selected value of select html and textbox value.
Now, I am using like below;
  <button type="button" id="btnDownload" onclick="location.href='@Url.Action("ExportToExcel", "Masters", new { ddlSearchBy = @TempData["ddlSearchBy"], txtSearchValue = @TempData["txtSearchValue"] })'">Download</button>
Can I directly pass the html control values in @Url.Action?
Edited:
Controller:
[HttpPost]
public ActionResult ExportToExcel(string ddlSearchBy, string txtSearchValue)
    {
        var grid = new GridView();
        grid.DataSource = from data in GetTaxMasterTable(ddlSearchBy, txtSearchValue)
                          select new
                              {
                                  Code = data.taxCode,
                                  TaxDescription = data.taxDescription,
                                  ClassDescription = data.classDescription,
                                  Location = data.locationShortName,
                                  Zone = data.zoneName,
                                  TaxValue = data.taxValue,
                                  Tax = data.taxPercentage,
                                  ModifiedDate = data.modifiedDate
                              };
        grid.DataBind();
        Response.ClearContent();
        Response.AddHeader("Content-Disposition", "attachment; filename = TaxMaster.xls");
        Response.ContentType = "application/vnd.ms-excel";
        StringWriter sw = new StringWriter();
        HtmlTextWriter htw = new HtmlTextWriter(sw);
        grid.RenderControl(htw);
        Response.Write(sw.ToString());
        Response.End();
        return RedirectToAction("TaxMaster");           
    }
jQuery:
$("#btnSubmitDownloadExcel").click(function (e) {
            var ddlSearchBy = $("#ddlSearchBy").val();
            var txtSearchValue = $("#txtSearchValue").val();
            $.ajax({
                type: "POST",
                url: "/Masters/ExportToExcel",
                data: JSON.stringify({ "ddlSearchBy": ddlSearchBy, "txtSearchValue": txtSearchValue }),
                contentType: "application/json; charset=utf-8",
                datatype: "json",
                success: function (data) {
                    alert(JSON.stringify(data));                        
                },
                error: function (data) {
                    alert("err");
                    alert(JSON.stringify(data));
                }
            });
        });
This code is not downloading the Excel.
 
    