I have some method
public ActionResult ExportToCSV(CellSeparators cellSeparator)
{
//
}
public enum CellSeparators
{
Semicolon,
Comma
}
How we can refer to that method correctly in html?
@Html.ActionLink("Exportar al CSV", "ExportToCSV", new { ?? })
Thank you!
Into your View.cshtml:
@Html.ActionLink("Exportar al CSV", "ExportToCSV", new { cellSeparator=CellSeparators.Semicolon })
Into your Controller:
public ActionResult ExportToCSV(CellSeparators? cellSeparator)
{
if(cellSeparator.HasValue)
{
CellSeparator separator = cellSeparator.Value;
}
/* ... */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With