Hello,
I use ASPRunner.NET (not PHPRunner), and I would like the exported file of my table admin_users to have the current date in its name, for example admin_users_22_10_2026.csv or admin_users_22_10_2026.xlsx.
In the forum I received an answer with PHP code (date() and header('Content-Disposition...') in the “Export page: Before process” event), but it does not apply to the .NET version.
I tried this C# code in the “Export page: Before process” event:
csharp
string data = DateTime.Now.ToString("dd_MM_yyyy");
string nomeFile = "admin_users_" + data + ".csv";
MVCFunctions.Header("Content-Disposition", "attachment; filename=\"" + nomeFile + "\"");The result:
• CSV: the file gets the right name, but its content is not the user data. It contains the internal JSON response of the export page ({"success":true,"pagesData":{...).
• XLSX: nothing is downloaded at all.
It seems that this event runs during the AJAX request, not during the real file download.
Could you please tell me in which event (or in which file/template) I should set the file name for CSV and Excel exports in ASPRunner.NET, and give me the exact C# code to use?
Thank you very much.