问题描述
嗨
我在iframe中打开一个视图。我正在调用一个在iframe中返回视图的URL(MVC),但是我收到错误
HiI 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();
}}
推荐答案
这篇关于错误:拒绝访问属性“x”的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!