Trying to use the Return File Async
MemoryStream ms = new MemoryStream(ExportDataBytes)
{
Position = 0
};
await Context.ReturnFileAsync(ms, âConfirmationTracking.csvâ, âtext/csvâ).ConfigureAwait(false);
from
<dot:Button Click=â{command: ExportGridData(exportData)}â Text=âExportâ ButtonTagName=âinputâ/>
Dotvvm version
Keep getting this error on the await line in C#:
DotVVM.Framework.Hosting.DotvvmInterruptRequestExecutionException: âRequest interrupted: ReturnFile (ConfirmationTracking.csv)â
The file is getting created in the temp directory as per
options.AddDefaultTempStorages(âtempâ);
That means your the file should be successfully returned (instead of the standard HTTP response). The exception is just a way to terminate the request processing; itâs a common pitfall, but we donât really have another way of doing that.
You should avoid handling this exception, it should be left to propagate back to DotVVM.
Can you please inspect the network communication, what response is returned from the postback? (just see devtools Network tab). Are there any messages in client-side log or the server-side log?
[NullReferenceException: Object reference not set to an instance of an object.]
DotVVM.Framework.Storage.d__12.MoveNext() in //src/Framework/Framework/Storage/FileSystemReturnedFileStorage.cs:80
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
System.Runtime.CompilerServices.ConfiguredTaskAwaiter.GetResult() +38
d__22.MoveNext() in //src/Framework/Framework/Hosting/DotvvmRequestContextExtensions.cs:268
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
System.Runtime.CompilerServices.ConfiguredTaskAwaiter.GetResult() +29
VeritasMVC.ViewModels.AllFiles.BankruptcyReports.d__7.MoveNext() +3528
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Web.Util.SynchronizationHelper.SafeWrapCallback(Action action) +114
I added too much code that interferred, so i simplified it. Also my VS is set to break on all faults. Never saw where i could continue and then it worked. Do you have any examples of custom form editor? thanks.