[RESOLVED]Actionlink doesn't seem to work.

in my view I have a BeginForm then within that I have the following which I’ve made as simple as possible:

 @Html.ActionLink("Export to Excel", "Export_to_Excel", "SchemeJoinerReport", new { @area = "Reports" }, new { @class = "excelIconSmall jsExportToExcel" })

In the SchemeJoinerReport controller I have the following:

[HttpPost]
public ActionResult Export_To_Excel()
{
   return null;
}

I’ve stripped it back to this at the moment just to ensure the controller method gets hit. When I hit the ActionLink nothing happens, the controller method doesn’t get hit.

You have [HttpPost], but links are HttpGet so change to HttpGet

Leave a Reply