检测是否我的网页是从code后面的一帧 [英] Detect if my page is in a frame from code behind
问题描述
有没有一种方法来检测,如果我的页面是一个框架内,从我的C#ASP.NET code后面?
Is there a way to detect if my page is inside of a frame from my C# ASP.NET Code Behind?
我知道有办法打出来的帧,或者检测框架,使用JavaScript,但我不感兴趣,对这个案子。我想知道,如果有检测帧服务器端的页面,使这是第一次到浏览器之前的方式,即,如果有某种请求的这一指示。
I know there are ways to break out of frames, or detect frames, using javascript, but I'm not interested in that for this case. I want to know if there is a way to detect the frame server-side before the page makes it's first trip to the browser, i.e. if there is some kind of indication of this in the request.
推荐答案
不,没有什么请求指示该页面是一帧中的报头发送 - 而这一切,你真的得去。
Nope, there's nothing sent in the headers of the request indicating that the page is in a frame - and that's all you really have to go on.
您可以做的最好的是看看的的引荐财产,如果它来自一个已知的取景现场(即images.google.com等),把它当作可疑。
The best you could do is take a look at the Referrer property, and if it comes from a known framing site (i.e. images.google.com etc) treat it as suspicious.
这篇关于检测是否我的网页是从code后面的一帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!