I use DotNetZip Library To Create Zip and Download File as a Zip File then, I want To Redirect or Refresh Same Page in Code behind, How Can O Do that(In Same PostBack)
ex:
zip.Save(Response.OutputStream);
Response.Redirect(url,false);
I want to Refresh Page After Downloading file,but It doesnt refresh if I use Response.Redirect
.
Found Solution .I did that with using javascript,i had set time out in link button onclientclick event. OnClick="LinkButton1_Click" OnScript OnClientClick="JavaScript:AutoRefresh(5000);"
In Onclick event did call code behind function and call time off function in onclientclick event
function AutoRefresh(t) {
// setTimeout("location.reload(true);", t);
setTimeout(function () { window.location = window.location; }, t);
}
使用 window.location.href = window.location.href;
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.