Click here to Skip to main content
15,867,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C#
Error: Permission denied to access property  "x"


So how can access the resource of View in IFrame.


when I am Adding

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



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/


-----------------
C#
public class HPFPaymentController : Controller
 {


 public ActionResult HpfMain()
        {

 return View();

}}
Posted
Updated 14-Oct-16 1:22am
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900