ilich / MvcReportViewer

ASP.NET MVC Html Helpers for ReportViewer Control.
MIT License
279 stars 131 forks source link

When call Mvc ReportViewer from another domain, SecurityError happend #75

Closed syaung closed 9 years ago

syaung commented 9 years ago

When I call web service Mvc ReportViewer from another domain, I got SecurityError at request to MvcReportViewer.aspx page.

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

Could you please advice How to fix it?

ilich commented 9 years ago

This issue is not related to MvcReportViewer. Please check MDN document about Same-origin policy and CORS(https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy) as the starting point. You can also read http://blog.cakemail.com/the-iframe-cross-domain-policy-problem/ and http://javascript.info/tutorial/same-origin-security-policy.

I'd recommend to host MvcReportViewer code on the same domain name and port. If you do not want to copy local reports to multiple places there is a work around using NTFS symbolic links created by mklink command (http://ss64.com/nt/mklink.html).