表单提交时出现javascript错误“htmlfile:访问被拒绝”

时间:2011-04-17 09:27:22

标签: security javascript-events internet-explorer-8

当用户在IE8中通过javascript命令form.submit从“onbeforeunload”的事件处理程序调用来关闭我的模态网页窗口时尝试回发时,我收到错误“htmlfile:Access is denied” 。 该怎么办?

<script language='javascript' for='window' event='onbeforeunload()'>
if (this.event.clientY<0){__doPostBack('__Page','__close')}
</script>

<script type="text/javascript">
<!--
var theForm = document.forms['MyModalForm'];
if (!theForm) {
theForm = document.MyModalForm;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;

    theForm.submit();//ERROR: Access is denied  !!!!!!!!!!!!!!

}
}
// -->
</script>    

我使用的是windows7,iis7.5,asp.net4.0。

感谢。

0 个答案:

没有答案