I have created an application server side that will create a pdf of a report when requested. Then the link of that report can then be sent back to the client.
My question is how do I hook this up to a button click event in my asp.net mvc website. So the scenario is:
- User fills in a few boxes.
- Clicks the generate report button.
- A little loading feedback indicator is shown.
- A request is sent to the server, the server then generates the PDF report and sends back a url link to the pdf that is being hosted on the server.
- The pdf will then be shown in the users browser (maybe in a new window).
Is this possible and is there any examples around that show how to do it?
Thanks in advance
I’ve done something similar.
When the user clicks the button it send an ajax request to the server passing some data:
The controller writes the document on the disk and sends back a guid which is the name of the PDF document.
This is the other bit of javascript which opens the file creating an IFRAME:
I’ve used jQuery BlockUI as loading feedback indicator.
Hope it helps.