Allow others to iframe my site in C#

Allow others to iframe my site in C#

Hi,

I have C# web application and I want to include some pages to iframe hosted on some other domain.

If I including it it is now getting included.

How to resolve this?

Thanks

View Answers

July 7, 2021 at 5:56 PM

Hi,

By default it is disabled and you have to enable this for your application developed in C#.

You must allow:

golbal.asax.cs set X-Frame-Options to AllowAll

in your application.

For this add following code into golbal.asax.cs file of your project:

 protected void Application_PreSendRequestHeaders()
 {
    Response.Headers.Remove("X-Frame-Options");
    Response.AddHeader("X-Frame-Options", "AllowAll");
 }

Hope this resolves your issue.

Thanks


July 7, 2021 at 5:57 PM

Hi,

if worked for me.

thanks a lot for sharing this code..

Thanks









Related Tutorials/Questions & Answers:
Allow others to iframe my site in C#
Allow others to iframe my site in C#  Hi, I have C# web application and I want to include some pages to iframe hosted on some other domain. If I... it is disabled and you have to enable this for your application developed in C#. You must
file uploads to my web site
file uploads to my web site  How can I allow file uploads to my web site
Advertisements
Site map - C Tutorials
| Site Map | Business Software Services India Tutorial Section   C Tutorials  | Java Tutorials | PHP Tutorials  | Linux...; | XPath Tutorials | HTML TutorialsADS_TO_REPLACE_1 C Tutorial Section
I need to display parts of my own website on another website in an iframe
I need to display parts of my own website on another website in an iframe  I need to display parts of my own website on another website in an iframe. please refer me how do i do
Form Code To Dispay Webpages On My Site
Form Code To Dispay Webpages On My Site  I want to use a form input box to display different pages on my site depending on the code the user types into the box. example: Producer Code 1234 would bring up Producer 1 page
ModuleNotFoundError: No module named 'cmsplugin-iframe'
ModuleNotFoundError: No module named 'cmsplugin-iframe'  Hi, My... named 'cmsplugin-iframe' How to remove the ModuleNotFoundError: No module named 'cmsplugin-iframe' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'cmsplugin-iframe'
ModuleNotFoundError: No module named 'cmsplugin-iframe'  Hi, My... named 'cmsplugin-iframe' How to remove the ModuleNotFoundError: No module named 'cmsplugin-iframe' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'yt-iframe'
ModuleNotFoundError: No module named 'yt-iframe'  Hi, My Python...-iframe' How to remove the ModuleNotFoundError: No module named 'yt-iframe' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'cmsplugin-iframe'
ModuleNotFoundError: No module named 'cmsplugin-iframe'  Hi, My... named 'cmsplugin-iframe' How to remove the ModuleNotFoundError: No module named 'cmsplugin-iframe' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'jupyterlab-iframe'
ModuleNotFoundError: No module named 'jupyterlab-iframe'  Hi, My... named 'jupyterlab-iframe' How to remove the ModuleNotFoundError: No module named 'jupyterlab-iframe' error? Thanks   Hi, In your
iframe application facebook login
iframe application facebook login  Create link to facebook from iFrame application
Iframe conetent - JSP-Servlet
Iframe conetent  Hi! i am loading web page in iframe in jsp page. when i am clicking on the link of iframe links it is loading in parent window that means in same window. i want to open the iframe content in new page
I need to launch multiple browsers installed on another windows M/C from my windows M/C over the network.
I need to launch multiple browsers installed on another windows M/C from my windows M/C over the network.  Please share the java code for the same as soon as possible
ModuleNotFoundError: No module named 'allow'
ModuleNotFoundError: No module named 'allow'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'allow' How to remove the ModuleNotFoundError: No module named 'allow'
ModuleNotFoundError: No module named 'allow'
ModuleNotFoundError: No module named 'allow'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'allow' How to remove the ModuleNotFoundError: No module named 'allow'
ModuleNotFoundError: No module named 'django-vkontakte-iframe'
ModuleNotFoundError: No module named 'django-vkontakte-iframe'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-vkontakte-iframe' How to remove the ModuleNotFoundError
ModuleNotFoundError: No module named 'taiga-plugin-iframe'
ModuleNotFoundError: No module named 'taiga-plugin-iframe'  Hi, My... named 'taiga-plugin-iframe' How to remove the ModuleNotFoundError: No module named 'taiga-plugin-iframe' error? Thanks   Hi
ModuleNotFoundError: No module named 'wsgi-seo-iframe'
ModuleNotFoundError: No module named 'wsgi-seo-iframe'  Hi, My... named 'wsgi-seo-iframe' How to remove the ModuleNotFoundError: No module named 'wsgi-seo-iframe' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'django-vkontakte-iframe'
ModuleNotFoundError: No module named 'django-vkontakte-iframe'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-vkontakte-iframe' How to remove the ModuleNotFoundError
ModuleNotFoundError: No module named 'HTML-Sanitizer-With-IFrame'
ModuleNotFoundError: No module named 'HTML-Sanitizer-With-IFrame'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'HTML-Sanitizer-With-IFrame' How to remove
check youtube iframe code
check youtube iframe code  I have a piece of code that checks the youtube embed code in this format: My PHP code looks like this now: //Check Embed Code $embedCode = $postData['embedCode
JavaScript write to IFrame
JavaScript write to IFrame...; This section illustrates you how to write to IFrame using JavaScript... iframe element. The variable div grabs the id of the div element which is added
C++Tutorials
This site is dedicated to advancing the understanding of Borland's C++ Builder...++ Builder Tutorial This site is dedicated to Borland C++ Builder, the Visual... Borland C++ Builder 3 Page -Tutorials This section of my Builder web
C++
C++  How can i write this in dev c
C++
C++  How can i write this in dev c
c#
c#  how to find out the size of the BMP image in C
html5 iframe
html5 iframe We are going to describe html5 iframe.We have created html5 iframe and implemented iframe tag. We have created a inline frame. A inline frame... of iframe: src:- URL of document which will be show in iframe. srcdoc:- Gives
displaying a physical webpage with frames in iframe
displaying a physical webpage with frames in iframe  i have iframe in my webpage, i have done the coding part for browsing the folders and viewing...,page with frames spoils the party. my code for getting the html file <
c++
c++  use a prgrm as an example to xplain-: a)class b)object c)message d)cope resolution operator
c++
c++  write a programme that calculates the area and circumference of a rectangle
c#
c#  how to find out the size of the BMP image
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
C++
C++  dear sir How to create windows form application for login screen using C++? USER Name -TESTADMIN Password -testuser
JavaScript getElementById Iframe
JavaScript getElementById IFrame...; We can also use document.getElementById() method with the IFrame. In this example we have created an html page into which we have one IFrame window which
c++
c++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples
c++
c++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples
C++
C++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples
C++
C++  Describe the principle advantages of deploying a linked list versus a static array when implementing a Queue or a Stack
C++
C++  Trace the bubble sort using the following integers,which represent the elements in an array. 5,7,3,8,6,7,3
c++
c++  write a prgrm tht accepts 3 integer values,then with a function to swap the values
C++
C++  I have been asked to write a programme that gets five values,gets the sum,average and product please help me
C#
C#  i need a code that will make program perform the basic operations upon the data Listview save, update and cancel
how to allow table editing
how to allow table editing   1**. hi... l've tried the method isCellEditable(int rowIndex, int colIndex) { return true but it doesn't enabled the user the editing of any cell why????????????? regards
c++
c++  write a program that gets a key or character from the keyboard and displays it ASII code in decimal, hexadecimal and binary form.It must also give a description of the key pressed
c++
c++  write a prgrm tht calculates the surface area of a cylinder.the prgrm shld find the circumfrance and have a function that calculates the fadius and another to calculate the surface area
C++
C++  write a prgrm tht gets five values,gets the sum,average &...; #include <conio.h> void main() { clrscr(); int a,b,c,d,e,sum; float average...;>b>>c>>d>>e; sum=a+b+c+d+e; average=sum/5; product=a*b*c*d
c++
c++  .write a program that accepts 5 subjects of a student,it should have a function to calculate the average & another function to grade.grade should be as follows-<40=E,40-49=D,50-59=C,60-69=B & >70
c++
c++  Consider the following function: int funcExercise7(int list[], int size) { int sum = 0; for (int index = 0; index < size; index++) sum = sum + list[index]; return sum

Ads