Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Issue with System.Web.HttpContext.Current.Server.Execute() Options
Drishty
Posted: Thursday, August 10, 2017 10:01:36 AM
Rank: Newbie
Groups: Member

Joined: 8/10/2017
Posts: 5
Hi Team

I have upgraded the EO.Pdf and EO.Web package from 3.0.84.2 to 17.2.14.0. One of my functionality broke down after the upgrade.
I am trying to call multiple (eg 2 - 3 ) aspx pages individually which gets converted to a StringWriter variable that is writer. but after the upgrade i am getting an error :

Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error executing child request for /report/abcdef.aspx.
One page can only have one ASPXToPDF control.

at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)
at System.Web.HttpServerUtility.Execute(String path, TextWriter writer)


The line where i am getting the error is System.Web.HttpContext.Current.Server.Execute(System.Web.HttpContext.Current.Request.ApplicationPath + reportUrl, writer)

The same code runs perfectly fine in the old version. I have only one AspxToPdf control on the page still i am getting the issue.

Can you please suggest on this.

Thanks and regards
Drishty
eo_support
Posted: Thursday, August 10, 2017 4:08:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
Hi,

Do you also have ASPXToPDF inside the page that you are trying to execute? If you have ASPXToPDF both in the calling page and the page to be called, then you will have this problem. If that's the case, you may want to remove the ASPXToPDF control from the page that you are trying to execute.

Thanks!

Drishty
Posted: Thursday, August 10, 2017 4:15:06 PM
Rank: Newbie
Groups: Member

Joined: 8/10/2017
Posts: 5
Hi

No i dont have that ASPXToPDF inside the calling Page at all. If i had it should have errored out the first time only but the thing is
i am getting the error when System.Web.HttpContext.Current.Server.Execute(System.Web.HttpContext.Current.Request.ApplicationPath + reportUrl, writer) is executed the second time.
Drishty
Posted: Thursday, August 10, 2017 4:16:16 PM
Rank: Newbie
Groups: Member

Joined: 8/10/2017
Posts: 5
Can you also tell me one more thing, in the older version i was getting the class EO.Pdf.Internal but in the upgraded version i dont have such class to import. Can this be causing the issue ?
eo_support
Posted: Thursday, August 10, 2017 4:17:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
Are you saying that you have ASPXToPDF in the page that is being called and you are trying to call it multiple times? If you use ASPToPDF, you would want to have a single ASPXToPDF on the root level (which should be your calling page in your page) and no other ASPXToPDF control anywhere else, including the page that is being called.
eo_support
Posted: Thursday, August 10, 2017 4:19:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
Drishty wrote:
Can you also tell me one more thing, in the older version i was getting the class EO.Pdf.Internal but in the upgraded version i dont have such class to import. Can this be causing the issue ?


No. This is not related. I believe in the new version all internal classes are moved into EO.Internal.
Drishty
Posted: Thursday, August 10, 2017 4:25:51 PM
Rank: Newbie
Groups: Member

Joined: 8/10/2017
Posts: 5
What i am trying to do is i need to attach two copies of the PDF to my email. SO thats why i call my code two times using this syntax.
First copy gets created and attached but when the code is called again to create the second copy i get this error. and my pdf copy is not generated.
Now i am not getting by the Root Level thing you are suggesting. I have placed my control in an page, and that aspx page is called two times .
Drishty
Posted: Thursday, August 10, 2017 4:26:31 PM
Rank: Newbie
Groups: Member

Joined: 8/10/2017
Posts: 5
My main concern is, the exactly same code is working perfectly fine in the older vsersion, but it has started showing error just after the upgrade.
eo_support
Posted: Thursday, August 10, 2017 4:38:57 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 19,668
We tried our best to make the transition seamless but there are subtle difference between the versions. There are a number of reasons why such differences exist.

One of the main difference is the new version uses a much newer browser engine. The old version uses a WebKit based browser engine, the new version uses a Google Chromium based browser engine. They originate from the same root but have since evolved separately for years. So this can introduce a number of differences.

Another source of differences is when we work through issues and add more checks in the code. Generally multiple ASPXToPDF instances should not be allowed in a single request/response cycle since the way ASPXToPDF works is by intercepting the response output stream and then use the contents of output stream as input of the HTML to PDF converter. If you have multiple interceptors in the pipeline then it can cause strange problems that is very difficult to troubleshoot. The old version did not check this situation. The new version does check and explicitly prohibits this situation. This can save developers considerable time by avoiding potentially dangerous situations from the start.

Considering all these factors, it is not practical to expect the new version work exactly the same on any scenario because the old version did work that way. We are constantly working hard to improve the product, and sometimes that does mean some code changes on your end would be required, even though we do our best to keep this at minimum.


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.