I have an action inside my controller, to download an XML file, with the following signature. public ActionResult Export (int id) {}, I do not understand in my page I have a button that calls a download script in the view, I need this script to trigger the export method inside my controller passing id as parameter. How do I access this?
//Método do controller
public ActionResult Export(int id)
{
var resource = WorkCenterFlow.GetResource(id);
using (var stream = new System.IO.MemoryStream())
{
resource.Export(stream);
var result = new FileContentResult(stream.ToArray(), "application/octet-stream");
result.FileDownloadName = string.Format("{0}.bin", (resource.FullName ?? "File").Replace(' ', '_').TrimEnd().TrimStart());
return result;
}
}
How would the view script look?
downloadParameter: function (e) {
??
},