Take the 2-minute tour ×

I have a requirement of just surfing through the net in my asp application and for that purpose i dropped an iframe.

But after that i found that certain sites likes google,fb,youtube etc wont open up in iframe due to security concerns.

After some discussions with my colleagues, i thought of a solution of displaying the web page(just like iframe) in a div and then displaying that div in a modal pop up,in which the user can navigate to any pages within that modal pop up

But after some initial searching ,i havent found anything where i can start towards my aim.So, i thought of asking it here.

Can anyone guide me to a proper direction to help me achieve my aim.Any help will be appreciated.


share|improve this question
This is what iframes are for, what are the "security concerns" you have? –  rrrr Dec 11 '12 at 9:44
Bit of a ridiculous requirement. If people are able to access your web-based application, it's fairly clear that they'll be able to surf the web too. What value are you getting from taking this approach? What about the user? –  Paul Alan Taylor Dec 11 '12 at 9:45
Paul : User can access the web ,thats ok..but i have a requirement to allow them to navigate through my application ,and then have to do a stuff with the url –  Vipin Nair Dec 11 '12 at 9:47
@rrrr : can u please check by adding an iframe and by opening google.com in it? –  Vipin Nair Dec 11 '12 at 9:47
@VipinNair If a site is preventing itself from being embedded in a iframe by using X-Frame-Options then the only other option is to make a HTTP request, parse the response and display the content yourself. However, this will break when the user clicks a link unless you handle all links yourself. Basically, you can't do what you want to do. –  rrrr Dec 11 '12 at 9:54

1 Answer 1

Look at this example:

$('#btnShowModal').click(function () {
                    some parameters to pass
                function (htmlResult) {
                        title: 'Title',
                        autoopen: true,
                        width: 'auto',
                        //height: 180,
                        resizable: false,
                        modal: true,
                        draggable: false
                    $(window).resize(function () {
                        $("#dialogWindow").dialog("option", "position", "center");
                    //position of modalWindow will always be in center of your browser window

            return false;

It's my button and div to modal window:

<input type="button" value="Add theme" id="btnShowModal" />
<div id="dialogWindow">
    <div id="dialogWindowContent">

I wrote it to my MVC application. And as understand, you should only rewrite post-method. As htmlResult you can return any html code and it will be shown in your modal window.

I hope, it will be usefull for you.

share|improve this answer
Thanks Evgenia for the Answer,but i also want a tab bar inside the dialog so that user can navigate to other pages as well in the modal pop up –  Vipin Nair Dec 11 '12 at 10:09
Now you're adding requirements that weren't in the original question. You need to clearly state all the issues you're having. Since getting blocking sites to show wrapped in your own content is a large enough hurdle, I think it only fair that you start a new question with this arbitrarily tacked on requirement once you've solved your first issue. –  J. Steen Dec 11 '12 at 10:19

Your Answer


