Welcome Guest Search | Active Topics | Sign In | Register

Is there anyway to use ASPXToPDF durring a AJAX call Options
Hillsborough County
Posted: Thursday, April 25, 2013 5:44:08 PM
Rank: Newbie
Groups: Member

Joined: 3/18/2013
Posts: 3
I get this error in my application:

Can not render as PDF because the current request is an ASP.NET AJAX callback. Please change your code so that the triggering control triggers a regular post back.

is there any way to make it work on a AJAX call
<eo:ASPXToPDF ID="ASPXToPDF1" runat="server"></eo:ASPXToPDF>

i have some other 3rd party controls and ASPXToPDF is throwing a error when i click submit it is in a updatepanel.

i really need this to work. is there a work around. i need a loading panel to show while it is creating the PDF it is taking a long time and the users dont know what to do.
eo_support
Posted: Thursday, April 25, 2013 8:10:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

The root of the problem is AJAX works with HTML. You can only AJAX back a piece of HTML (including JavaScript). That means you can not AJAX back a PDF file. As such you have to give up this idea.

Thanks!
Automotive Global
Posted: Monday, May 23, 2016 12:41:52 AM
Rank: Newbie
Groups: Member

Joined: 2/24/2015
Posts: 4
I'm also getting the same error. Your suggestion is to give up AJAX post back idea.
Could you please suggest is there any way I can achieve the same functionality? All I want is, when user clicks on pdf file to be downloaded, I would like to show a waiting cursor, so that the user knows the file is being sent from the server. At the moment, with out ajax I can download the file, but no waiting cursor displayed. Sometimes it take 20 seconds for file to download, and without any waiting cursor, user really don't know if the file is download click is working or not!

Please help.

Regards,
eo_support
Posted: Monday, May 23, 2016 11:31:12 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Automotive Global wrote:
I'm also getting the same error. Your suggestion is to give up AJAX post back idea.
Could you please suggest is there any way I can achieve the same functionality? All I want is, when user clicks on pdf file to be downloaded, I would like to show a waiting cursor, so that the user knows the file is being sent from the server. At the moment, with out ajax I can download the file, but no waiting cursor displayed. Sometimes it take 20 seconds for file to download, and without any waiting cursor, user really don't know if the file is download click is working or not!

Please help.

Regards,


In that case you will need to separate the whole task into different requests/sub tasks. For example, if you separate the PDF creation into a separate page then you can use an iframe to pull that page while your main page can continue to do whatever you want to do --- for example, to display a "Please wait..." message. Another way is to separate the PDF creation into a background task and then return immediately just saying "PDF creation in progress....". And then you can AJAX back to the server to check the result and send the request back to the client as soon as the result is done. The key is if you do everything in a whole as a single round trip, then that's the only trip to carry the PDF file down to the client and that round trip can not be AJAXed, but you are free to add other round trips in the mean time.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.