Skip to content Skip to sidebar Skip to footer

How To Access A One Of The Asp.net Core Controller Action View Into An Iframe Using React Application?

When iam trying to access one of the asp.net core application controller view from react application, In the browser console iam getting eror like 'Refused to display 'http://loca

Solution 1:

X-FRAME-OPTIONS is a web header that can be used to allow or deny a page to be iframed. This is very important when protecting against clickjacking attempts.

Thought it is not recommended , but if you want to change the make your application be iframed , you can try to add below config in Configure function of asp.net core application to set X-Frame-Options response header , for example:

app.Use(async (context, next) =>
{
    context.Response.Headers.Add("X-Frame-Options", "AllowAll");
    await next();
});
app.UseMvc();

Post a Comment for "How To Access A One Of The Asp.net Core Controller Action View Into An Iframe Using React Application?"