开发者

Javascript error "htmlfile: Access is denied" on form submit

开发者 https://www.devze.com 2023-02-27 01:48 出处:网络
When trying to do post back when the user press to close my modal web page window in IE8by the Javascript command form.submit calling from the event handler of onbeforeunload, I get the error:

When trying to do post back when the user press to close my modal web page window in IE8 by the Javascript command form.submit calling from the event handler of onbeforeunload, I get the error:

"htmlfile: Access is denied".

What to do?

<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  !!!!!!!!!!!!!!

}
}
// -开发者_JS百科->
</script>    

I am using windows7, iis7.5, asp.net4.0.

0

精彩评论

暂无评论...
验证码 换一张
取 消