htmlasp.net-mvcarticulate-storyline

MVC - Rendering a static HTML page that refers to other static resources


I have created a project in an application called 'Articulate' that publishes as a file/folder structure of html pages and resources like images, videos, etc. Aside from MVC, you would normally just upload it to your server and be done.

In MVC, I'm trying to understand the best way to accomplish the following:

1) Put this published output in a folder in my MVC web project - as is - without going in to re-write the published html output 'Articulate' produces.

2) Allow the html pages to refer to resources in this embedded file/folder structure (other html pages in the structure, images, videos, etc.)

3) Be able to render a page in a way similar to an iframe, so that if it reloads or forwards to another page, it does so only within the rendered area, such as a div/modal.

I have seen a couple similar posts that didn't pan out or didn't match all my criteria above.


Solution

  • After much research of approaches, the only way I found to meet all of my needs was to create a partial view and within it put an iframe.

    <div class="modal-body">
        <iframe src="~/StaticFolder/staticPage.html"></iframe>
    </div>
    <div class="modal-footer text-right" style="padding-right: 75px; margin-left: 0;">
        <button type="button" class="btn btn-default" id="CancelModal" data-dismiss="modal">Close</button>
    </div>
    

    This approach maintains all referential links inside the html pages and allows me full control over calling the partial with an MVC structure.