We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Postback problem on the Response Object

Hello all. I am having an issue where the postback is not happening on the response object to save the file dialog. How can I fix this somehow, I need the page to postback.

workbook.Save(OriginalFileName, FileFormatType.Default, SaveType.OpenInExcel, Me.Response)

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for Considering Aspose.

Well, I think the information provided by you is not sufficient to figure out the problem, It will be very appreciated, if you can provide us some more details (sample code & template file) so we can figure out why this issue is occurring.

And, first you can try the attached latest version of Aspose.Cells to check, whether it resolves your issue.

Thank you & Best Regards,

Here is all the information. You only get one response object in your page. So when I hit this line:

workbook.Save(OriginalFileName, FileFormatType.Default, SaveType.OpenInExcel, Me.Response)

after that line in my code the page will no longer postback because the response object has been called for the excel prompt. So I even tried many workarounds such as a response.redirect after but it throws a http response header error because of the same issue the response has been used. I need to somehow have this page postback so my grids reload on it etc. after this workbook response call. You can try it yourself, just use your API and create a excel response like above, create a button on your page to call a sub and then you get prompted to save the excel file, at that point the page will not postback because the response object has been used. This is not good because I need my page to postback to refresh grids etc.

I have the latest version of the API

Hi,

Could you try to save your excel file to streams/disk and then use ASP.NET Response object to load the file to check what went wrong to further debug the issue.

e.g..,

Dim workbok As New Workbook()
'.............your code goes here


Dim stream As New MemoryStream()
workbook.Save(stream, FileFormatType.Default)
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition", "attachment; filename=Mybook1.xls")
Response.BinaryWrite(stream.ToArray())
Response.Flush()
Response.BinaryWrite(stream.ToArray())
Response.Flush()
..........

Thank you.

I tried this but the same issue exists the postback never happens after the response. I was hoping there was some workaround you guys knew of.

Hi,

Well, you see without involving Aspose.Cells APIs you also find the same issue, do you use http compression on IIS in your environment, it so, could you disable it. It might be a browser type issue too, which browser type you are using.

We will further look into your issue.

Thank you.