In short, to check if a page is in an iframe, you need to compare the object's location with the window object's parent location. If they are equal, then the page is not in an iframe; otherwise, a page is in an iframe.
In action: iframeAn <iframe> tag hosts a separate embedded window, with its own separate document and window objects.
How can I detect server-side (c#, asp.net mvc) if the loaded page is within a iframe? Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With