Free Support Forum - aspose.com

Javascript error when saving to page

Hi,

our application use Aspose.Excel to im- and export large amounts of data. Prior to exporting the data to excel the data is displayed in the Infragistics WebGrid. The asp page has the grid and a button which is used for exporting the datat to excel using Aspose.Excel.

Once the button is clicked the excel is saved to Page.Response with the SaveType.OpenInExcel set. After saving the excel file to harddisk or opening it directly the Infragistics WebGrid throws an javascript error "Access denied" when moving the mouse over the grid.

I know that the problem seems to stuck anywhere inside the WebGrid, but maybe you've had expierence with that and know a solution.

Kind regards,

Michael

As I know, only when you saving file to disk, Aspose.Excel may throw "Access denied" exception if your web application doesn't have rights to write data to specified path.

I don't have clues for your problem. Could you post a screenshot when you meet this problem?

No it’s not Aspose.Excel which throws the error. The table on the html page has a onmousemove eventhandler registered. Now after sending the excel back to the page this handler can not be called anymore, because it throws “Access denied” as soon as my mouse moves over the grid.

Does this error occur after you send file to client browser? What happens if you save the file to disk instead of sending it to client?

Yes the error occurs after the file is sent to the browser and it does not occur when saving it to disk. I made up a little demo project. Only a small page with a button. When clicking the button the server reads a excel file from the disk and sends it back to the browser. Then I looked at the html code which resulted after the browser gets refreshed. The code missed the form and button tags, but the button was still shown on the page.

No clues for this problem.

You can try:

1. Redirect to a new aspx page. In the Page_Load event, send the file to client browser.

2. You can also try our web component: Aspose.Excel.Web at http://www.aspose.com/Products/Aspose.Excel.Web/ .