I want to recognize if any page of my site called from an iframe in an external site
I can change my _layout.cshtml.
In other word I want to have two layout one for users visit my site directly an another layout for users that visit my site from another sites (other site use iframe for reference to my site)
My problem is how to detect this two type and change my layout?
Edit I need to know iframe in server side to can change it. I dont wan redirect user to certain action by javascrip I need a command like this in some of my view but how?
@{
if(ViewBag.Iframe == true)
{
layout ="_Iframelayout.cshtml"
}
else
{
layout ="_Normallayout.cshtml"
}
}