Check out example codes for "how to do Employing defensive code in the UI to ensure that the current frame is the most top level window in c#". It will help you in understanding the concepts better.

Code Example 1

<system.webServer>
  ...
  <httpProtocol>
    <customHeaders>
      <add name="X-Frame-Options" value="SAMEORIGIN" />
    </customHeaders>
  </httpProtocol>
  ...
</system.webServer>

Code Example 2

<script>
    try {
        if (top.location.hostname != self.location.hostname) throw 1;
    } catch (e) {
        top.location.href = self.location.href;
    }
</script>

Learn ReactJs, React Native from akashmittal.com