检测如果一个网页是一个iframe中 - 服务器端 [英] Detect if a page is within a iframe - serverside

查看:102
本文介绍了检测如果一个网页是一个iframe中 - 服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何检测服务器端(C#,asp.net MVC)如果加载页面是一个iframe中?谢谢

How can I detect server-side (c#, asp.net mvc) if the loaded page is within a iframe? Thanks

推荐答案

这是不可能的,但是。

<iframe src="mypage?iframe=yes"></iframe>

然后检查服务​​器端是否包含查询字符串IFRAME = YES
或者与Referer头由浏览器发送。

and then check serverside if the querystring contains iframe=yes or with the Referer header send by the browser.

这篇关于检测如果一个网页是一个iframe中 - 服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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