Iframe 在asp.net mvc中加载外部网站

Iframe 在asp.net mvc中加载外部网站,iframe,model-view-controller,Iframe,Model View Controller,我现在添加一个iframe标记 <iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="{{frameSrc}}" frameborder="0" scrolling="no" width="100%" height="100%"></iframe> 在我的asp.net mvc网站中,我将使用它加载外部www.baidu.com。 但结果是: 我在网上搜索了一

我现在添加一个iframe标记

<iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" src="{{frameSrc}}" frameborder="0" scrolling="no" width="100%" height="100%"></iframe>

在我的asp.net mvc网站中,我将使用它加载外部www.baidu.com。 但结果是:


我在网上搜索了一下,没有找到答案。我想可能是mvc中的路由问题导致了这种情况,你知道吗?

我需要像这样更改src:$scope.frameSrc=$sce.trustAsResourceUrl(“http://“+$scope.selectedMonitor.videonvradress”);在angularjs


原因是默认情况下angularjs将阻止直接加载源网站,以确保安全。在angularjs中使用$sce插件可以解决此问题。

通过使用$scope.frameSrc=$sce.trustAsResourceUrl(“http:/”+$scope.selectedMonitor.videonvradress)解决了此问题;在angularjs