简体   繁体   中英

PdfHanlder.ashx working on IIS Express , but not working on IIS Production Server

I have developed an ASHX file that outputs a PDF .Everything works wonderful when I debug it on Visual Studio. If I enter the url directly from the browser it is working fine. It downloads PDF. I have a Default.aspx that shows the PDF (from the ASHX url ) in an object html control(thats the one i am interested in)

The problems becomes when I publish the app to a virtual directory on IIS Production Environment. No PDF is loaded in Default.aspx , but if I enter the ashx url directly in the browser it downloads the PDF correctly. What i am doing wrong? I am using IIS 5.1 Thanks in advance

It was not fault of ASHX,the html object was referencing a bad URL for the PDF. In Local server the URL was

But in server it was deployed to a site "Testing" so the url was

I was referencing the pdf inside the from
- http://server/PdfHanlder.ashx?Id=101&.pdf So i missed the /Testing prefix...once it gets fixed it started to works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM