Hi,
We have fully tested your sample file again, at last we found the following code
Response.ContentType = "text/calendar";
Response.AddHeader("content-disposition", "attachment;
filename=Appointment.ics");
Response.Write(sbICSFile);
When user set
the ContentType and add header for file download , the browser will stop
response for page reload, it is the default workflow of all browsers
Currently we can supply to your a
solution to solve the your question
add the follow javascript code to
page
<script type="text/javascript">
$(document).ready(function ()
{
$('#CreditGrid_SAVE').bind("click", function(){
CheckFileDownload();
});
});
var pageLoadCheckTimer;
function CheckFileDownload()
{
var token = new Date().getTime(); //use the current timestamp as the token
value
$('#download_token_value').val(token);
pageLoadCheckTimer = window.setInterval(function () {
var cookieValue = $.cookie('fileDownloadToken');
if (cookieValue == token)
finishDownload();
}, 1000);
}
function finishDownload()
{
window.clearInterval(pageLoadCheckTimer);
$.cookie('fileDownloadToken', null); //clears this
cookie value
document.getElementById("__EVENTARGUMENT").value = "";
document.getElementById("__EVENTTARGET").value = "";
document.getElementById("CreditGrid_XMLDATA").value = "";
theForm.submit();
}
</script>
Add “input” to page
<input id="download_token_value" name="download_token_value" type="hidden" />
For the server side ,add the follow code to
page
Response.AppendCookie(new HttpCookie("fileDownloadToken", Request.Form["download_token_value"]));
It will work.
By the way, we have also added an attachment for you to test ,
when run the sample , please ,add “Aspose.Cells.GridWeb.dll” to bin
directory.