错误:拒绝访问属性“x”的权限 [英] Error: permission denied to access property "x"

查看:95
本文介绍了错误:拒绝访问属性“x”的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在iframe中打开一个视图。我正在调用一个在iframe中返回视图的URL(MVC),但是我收到错误

Hi I am opening a view IN Iframe. I am calling a url (MVC) which returning a view in Iframe but i am getting error

Error: Permission denied to access property  "x"





那么如何在IFrame中访问View资源。





当我添加





So how can access the resource of View in IFrame.


when I am Adding

Response.Headers.Remove("X-Frame-Options");
Response.AddHeader("X-Frame-Options", "AllowAll");







以下错误



未捕获的安全错误:使用原点http:// localhost:50304阻止访问具有原点的帧的帧 HTTP://本地主机:49835\" 。协议,域名和端口必须匹配。



我尝试过:



Iframe Url = http:// localhost:50304 / HPFPayment / HpfMain /





-------- ---------




following Error

Uncaught SecurityError: Blocked a frame with origin "http://localhost:50304" from accessing a frame with origin "http://localhost:49835". Protocols, domains, and ports must match.

What I have tried:

Iframe Url =http://localhost:50304/HPFPayment/HpfMain/


-----------------

public class HPFPaymentController : Controller
 {


 public ActionResult HpfMain()
        {

 return View();

}}

推荐答案

协议,域和端口必须匹配。 - Google搜索 [ ^ ]


这篇关于错误:拒绝访问属性“x”的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆