以下代码不起作用(在 windows server 2008、IE8、Visual Studio 2010 上运行)
if (!cs.IsStartupScriptRegistered(csType, csName))
{
StringBuilder csText = new StringBuilder();
csText.Append("<script type=\"text/javascript\">");
csText.Append("window.open('" + strCheminFile + "','','menubar=yes,toolbar=yes,scrollbars=yes,status=yes,resizable=yes,width=800,height=600') ");
csText.Append("</script>");
cs.RegisterStartupScript(csType, csName, csText.ToString());
}
strCheminFile 包含路径 file:///C:/Fichiers_Excel/CalculProcedure/procedure.xlsm
以下代码生成到 aspx 网页中:
<script type="text/javascript">window.open('file:///C:/Fichiers_Excel/CalculProcedure/procedure.xlsm','','menubar=yes,toolbar=yes,scrollbars=yes,status=yes,resizable=yes,width=800,height=600') </script></form>
</body>
Windows 抛出以下异常:访问被拒绝。这似乎是 IE8 的安全问题。谢谢