MVC iframe Alternative

I am looking for an alternative to using IFRAME to load a full page on a wrapper page on all pages using MVC3. I need a wrapper page for centralized login and authentication and would like to dynamically load other pages in a shell type section, for example, load a module in WPF. I previously used IFRAME for this, but I would like to keep the navigation intact (i.e. the Back button will go to the previously loaded plugin page instead of the previous wrapper page). I thought I could accomplish this with partial views, but could not find a way to load a partial view from a completely different project (or from an already hosted site). Any ideas?

+3
source share
2 answers

You can make an ajax call to get the content from an external site and put it in the right place on your parent html page. This can be done when loading the page.

using jquery, it will be something like:

$.ajax({
        url: 'http://www.externalsite.com',
        cache: false,
        dataType: "html",
        success: function (data) {
           $("#divInsideParentPage").html(data);
        }
    });
+2
source

Check out this page under “Layout / MasterPage Scripting - The Basics”

In short, you create a master template and insert placeholders for where your content will appear ...

How exactly this works depends on the viewing mechanism used (Razor, etc.)

EDIT:

WRT History/Back, history.js . . , ( AJAX - ).

0

All Articles