Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if a page is within a iframe - serverside

Tags:

People also ask

How do you check if a page is inside an iframe?

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.

Does iframe have its own window?

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