Choosing a Traditional or Single Page Application

When you scaffold an MVC web application using the Scaffold Unisys Controller for ePortal Data Source with Views Dialog or the Scaffold Unisys View Dialog, you can select either of the following architectures for your application.

Traditional MVC Web Application

With an ePortal Traditional MVC web application, each client message in the data source results in a separate view (.cshtml) file. When the application is run, each view results in a complete new web page that is loaded into the web browser. As each page is submitted, an entirely new page is fetched into the browser.

This is the typical way that most web sites are structured and is appropriate for most web applications. This is the default architecture selected when you scaffold your application.

Single Page Application MVC Web Application

With an ePortal Single Page Application MVC web application, each client message in the data source also results in a separate view (.cshtml) file. When the application is run, an index page loads. As the user navigates through the application, the index page is not reloaded; instead, AJAX is used to fetch the HTML for the next view. The fetched HTML is inserted into the existing index page without reloading the entire page.

This approach has the following advantages:

To generate views that use the ePortal Single Page Application architecture, do the following:

Notes:

  • AJAX was originally an acronym for Asynchronous JavaScript and XML. However, the term has evolved, and is now used in any case where JavaScript is used to dynamically load content, even if that content is not XML.

  • The ePortal implementation of a Single Page Application for MVC is different from other implementations of the Single Page Application architecture. The ePortal implementation dynamically loads HTML from the server and inserts that HTML into the existing page. Other implementations dynamically load JSON and process that JSON in the browser using JavaScript to dynamically generate the new HTML. In other words, the ePortal implementation uses server-side generation of HTML, whereas other implementations often use client-side generation of HTML.

  • Other implementations of Single Page Application architecture (such as the Microsoft implementation that uses Web API) are currently not compatible with ePortal data sources.