TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deepak Tiwari
NA
27
1k
How to prevent whole site to load in iframe except one page
Sep 11 2018 7:02 AM
I've implemented an asp.net MVC site. I want to prevent the whole site to load in the iframe except one page. I added below code under web config.
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="SAMEORIGIN" />
</customHeaders>
</httpProtocol>
This code of web config prevents the whole site to load in the iframe. I try to remove 'X-Frame-Options' option from the view where only I want to allow the iframe
public ActionResult Ads()
{
Response.Headers.Remove("X-Frame-Options");
return View();
}
But when i run this code X-Frame-Options not removed from header. Please suggest me what can I do?
Reply
Answers (
0
)
Firebase and C#
UWP QR code scanning