1
I have an action inside my controller, to download an XML file, with the following signature. public Actionresult Export(int id){}, no understand on 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?
//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;
}
}
What the view script would look like?
downloadParameter: function (e) {
??
},
Thanks man, it worked like this!
– fernando tso