Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Unassigned: Passing parameters to Action Method from ActionLink [1565]

$
0
0
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

Viewing all articles
Browse latest Browse all 7215

Trending Articles