2017-04-03 33 views
0

主要形式:停止使用Javascript从开球上后退按钮

从代码中调用的背后,一个下拉列表框,我创建了一个URL生成PDF,并关闭该表单(pdfGenerator的),然后返回回的MainForm:

string redirect = "<script>window.open('/pdfgenerator/BL/" + customerdocument.DocumentId');</script>"; 
this.Response.Write(redirect); 

的的pdfGenerator创建PDF文件,然后关闭自动此网页”

HttpContext.Current.Response.Clear(); 
HttpContext.Current.Response.ContentType = "application/pdf"; 
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + filename); 
pdfFileStream.CopyTo(HttpContext.Current.Response.OutputStream); 
HttpContext.Current.Response.Flush(); 
HttpContext.Current.Response.SuppressContent = true; 
HttpContext.Current.Response.OutputStream.Flush(); 
HttpContext.Current.Response.OutputStream.Close(); 
HttpContext.Current.Response.End(); 

现在,当我默认/主网页,并导航到任何其他网页,一个nd点击后退按钮,pdfgenerator页面将弹出并生成另一个pdf,即使未点击下拉菜单。我试图设置断点,以查看主页面上是否有任何JavaScript正在调用以启用此功能(没有)。然后我查看PDF生成器上的推荐页面(其中指出了主页面,而不是我刚刚点击后退按钮的页面)。有谁知道这是什么吗?如何阻止它?或以某种方式卸载JavaScript,以免在后退按钮上再次调用?

回答

0

我们最终删除了后面的c#代码,并直接使用javascript。现在没有回传(当然)。