Creating an MVC Web Application

An MVC Web Application uses Model-View-Controller (MVC) and is intended for users who will access your application by running a Web browser on a wide variety of devices including smartphones, tablets, laptops, and desktop computers.

Refer to Choosing Web Forms or MVC for more information on Model-View-Controller (MVC).

This project uses the Bootstrap responsive framework (http://getbootstrap.com) to adapt the display of the contents to the size of the device screen.

Notes:

  • Bootstrap supports most recent browsers, but is not compatibile with older browsers (for example IE 7 or earlier). For a complete list of supported browsers, refer to http://getbootstrap.com/getting-started/#support.

  • This topic describes a simple case of adding an MVC Web project to an existing solution that already contains a data source project. Other use cases are also possible, such as cases where multiple data source projects exist. Refer to Reference Information for Scaffolded Projects for more information.

Procedure 1 - Adding the MVC Presentation Project

  1. In Solution Explorer, right-click the solution node, click Add, and click New Project....

  2. In the Create a new project dialog box, do the following:

    Notes:

    • Select C# or All Languages from the Language list.

    • Select Windows or All Platforms from the Platform list.

    The ePortal templates are not displayed if other values are selected.

    1. Select ePortal Presentation from the Project Type list.

      The ePortal Presentation templates are displayed.

    2. Do any one of the following to select the template:

      • From the templates list, select MVC Web Application with Bootstrap, and then click Next.

      • Enter MVC Web Application with Bootstrap in the search option, select the template from the search result, and then click Next.

  3. Optionally, change the Project name, Location, and Framework, and click Create.

    Notes:

    • If you do not select a desired Framework, a default Framework version is selected.

    • For information on selecting the .NET version, refer to Multi-Targeting Issues.

  4. In Solution Explorer, right-click the new presentation project name and select Add Unisys ePortal Data Source Reference.

    The Add Unisys ePortal Data Source Reference Dialog box appears. For more information, refer to Adding Unisys ePortal Data Source Reference.

  5. Select the desired data source project and click OK.

  6. Click Build and select Build Solution to build the project. Refer to Building Your ePortal Solution for more information.

Procedure 2 - Controlling the Look and Feel

Once you have created your presentation project, you can control the look and feel of your Web pages. Review the topics at Controlling the Look and Feel of Your Presentation for more information. If you want to localize your presentation, refer to Localization Support for MVC.

Scaffold Your Presentation

Note: Before scaffolding your solution, review the topics at Controlling the Look and Feel of Your Presentation. Some of these steps are best performed before you scaffold your presentation project and some steps cannot be completed until after you have scaffolded your presentation project.

Refer to Scaffolding for more information on scaffolding your solution. In particular, refer to Scaffold Unisys Controller for ePortal Data Source with Views Dialog to scaffold your MVC application. Complete the dialog as described in the help reference.

Procedure 3 - Controlling the Behavior

Once you have scaffolded your presentation project, you can control the runtime behavior of your application. Refer to Controlling the Runtime Behavior of Your Presentation for more information.

Procedure 4 - Testing

Refer to Testing a Presentation Project.

Next Step

Continue to Staging a Presentation Project.