Reputation: 3
I am trying to dynamically generate a file for user to download depending on the records in database. I have successfully done this by using stream result.
The problem is, when there is no data available to download, I want to show a dialog in the browser to tell the user 'No data available'.
Can anybody tell me how should this be done? When there is no data, the input stream to download is null and there will be exception..
Thanks
Upvotes: 0
Views: 209
Reputation: 160211
You would use a different result and handle notification on the client side. There are any number off ways to simulate a dialog box via HTML and JavaScript, or you could use plain HTML.
Upvotes: 1