Prevent Click-jacking

 

Edit the web.config file (Optional)

You can also add the header directly by modifying the web.config file of your website:

  1. Open the web.config file located in your site's root directory.

  2. Add the following code within the <system.webServer> section:

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

    If you want to allow framing only within the same origin, use SAMEORIGIN instead of DENY:

    xml
    <add name="X-Frame-Options" value="SAMEORIGIN" />
  3. Save the web.config file and restart IIS (if necessary) to apply the changes.

Comments

Popular posts from this blog

Tutorials on Unity Probuilder and Progrids

difference between field and property in c#