Hi
I want to pass dropdown values to action method from ActionLink but while debugging second parameter coming properly but first one is null.
Have a look at my code.
Razor:
@Html.DropDownListFor(x => x.SelectedField, new SelectList(Model.Filter, "Id", "Name", Model.SelectedField),new { @class = "select1", style = "width:120px;" } )
@Html.DropDownListFor(x => x.SelectedYear, new SelectList(Model.ReportYears, "ID", "Name", Model.SelectedYear), new { @class = "select1", style = "width:120px;" })
@Html.ActionLink("Export to PDF", "DownloadRevenuePdfFile", "EmailReport", new { month = Model.SelectedField, year = Model.SelectedYear }, new { @class = "black" })
Controller
public void DownloadRevenuePdfFile(string month, string year)
{
//code
}
Thanks
I want to pass dropdown values to action method from ActionLink but while debugging second parameter coming properly but first one is null.
Have a look at my code.
Razor:
@Html.DropDownListFor(x => x.SelectedField, new SelectList(Model.Filter, "Id", "Name", Model.SelectedField),new { @class = "select1", style = "width:120px;" } )
@Html.DropDownListFor(x => x.SelectedYear, new SelectList(Model.ReportYears, "ID", "Name", Model.SelectedYear), new { @class = "select1", style = "width:120px;" })
@Html.ActionLink("Export to PDF", "DownloadRevenuePdfFile", "EmailReport", new { month = Model.SelectedField, year = Model.SelectedYear }, new { @class = "black" })
Controller
public void DownloadRevenuePdfFile(string month, string year)
{
//code
}
Thanks