Response in save : no html render

Hi from France !

I’ve got problem with aspose words.I’ve got 2 pages :

First is form for user, and a button
This button redirect user :

Protected Sub btImprBordereau_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btImprBordereau.Click

Session("WFImprimeBordereau_idBordereaux") = uwgCertificats.Rows(0).Cells.FromKey("idBordereau").Value
Session("WFImprimeBordereau_retour") = Me.Page.AppRelativeVirtualPath
Response.Redirect("~/Construction/WFImprimeBordereau.aspx")
End Sub

in the second page (WFImprimeBordereau.aspx) i generate the document :

Page_Load :
If IsPostBack = False Then
GenererDocumentBordereau()
End If

At the End of GenererDocumentBordereau Sub, i’ve got :

DstDoc.Save(Me.Response, "Bord_" & Session("HelixChiffreBidon") & Session.SessionID.ToString & ".doc", ContentDisposition.Attachment, Aspose.Words.Saving.SaveOptions.CreateSaveOptions(SaveFormat.Doc))

I don’t see “WFImprimeBordereau” rendered Html page, because me.Response contains “msWords” header and directly windows pop up.

In very old aspose words version i’ve got my html page (with my back button) and a windows pop up (save,open,cancel) for my word file.

How can resolve it ?

Thanks for your help and excuse me for my english.

Hi Vincent,

Thanks for your inquiry.

*conan76:

I don’t see “WFImprimeBordereau” rendered Html page, because me.Response contains “msWords” header and directly windows pop up.

In very old aspose words version i’ve got my html page (with my back button) and a windows pop up (save,open,cancel) for my word file.*

As per my understanding, the problem you are facing is not related to Aspose.Words. It is related to browser setting. Please see the attached image for Firefox download setting. It would be great if you please share some more detail about your query. Please share if your are facing any issue while document conversion and sending document to client browser.

Moreover, I suggest you please read following documentation links for your kind reference.
https://docs.aspose.com/words/net/save-a-document/
https://reference.aspose.com/words/net/aspose.words/contentdisposition/