在IE中通过javascript调用C#函数时出现问题 [英] Problem in Invoking C# function By javascript in IE
本文介绍了在IE中通过javascript调用C#函数时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我正在FileUpload OnChange事件上上传图像,并且在Mozilla中工作正常
但不能在IE中使用
错误:中断JScript运行时错误-拒绝访问
Hello
I am uploading image on FileUpload OnChange event and it''s working fine in Mozilla
but not working in IE
Error: Breaking on JScript Run time error-Access Denied
function CheckFileUpload()
{
document.getElementById('<%= Submit.ClientID %>').click();
}
我的C#函数是这样的
My c# function like this
protected void SubmitImageUpload_Click(object sender, EventArgs e)
{
}
感谢U
Thank U
推荐答案
您似乎正在从iframe访问父框架?如果您在jscript运行时遇到权限被拒绝的问题,则可能是受信任的站点/跨域脚本问题,两个域都添加到了受信任的站点吗?
有时在IE8中,document.domain的设置速度不够快,我不得不在超时后调用iframe函数才能使其正常工作-否则我会遇到相同的问题.
You seem to be accessing a parent frame from an iframe? If you''re getting permission denied issues with jscript runtime it may be a trusted site/cross domain scripting issue, are both domains added to your trusted sites?
Sometimes in IE8 the document.domain isn''t set fast enough, I''ve had to call iframe functions after a timeout before to get it to work - or I get the same issues.
这篇关于在IE中通过javascript调用C#函数时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文