Note: This topic applies to the MVC Web Application project type only. Refer to Creating an MVC Web Application for more information.
Scaffolding is the technique used to generate the presentation code that the application can use at run time. The generated code represents a useful starting point for your application that you may want to further modify to refine your application.
You can scaffold all client messages in a particular data source using the Scaffold Unisys Controller for ePortal Data Source with Views Dialog; however, you might only want to scaffold a single client message. For example, if you updated the client message in a data source, you could use the procedure described in this topic to regenerate the view for that client message.
Perform the following steps to scaffold one particular client message from a data source:
Click Build and select Build Solution to build the solution.
In Solution Explorer, navigate to the particular folder where you wish to add a view. Typically, this is Views/<controllername> under your MVC Web presentation project, where <controllername> is the name of your controller.
Right-click the folder and select Add, then select New Scaffolded Item.
The Add Scaffold dialog opens.
On the Add Scaffold dialog, select Unisys Model View and click Add.
The Scaffold Unisys View Dialog opens.
Complete the dialog as described below.
After completing the dialog fields, click OK to start scaffolding.
Note: If scaffolding would overwrite any existing files, you are given a chance to confirm before overwriting.
Dialog Fields
The dialog fields are described below:
Model class
Select the name of the model class to scaffold. A model class is generated for each client message in an ePortal data source project. The model class for an ePortal client message has a name of the form <datasourcename>.Client.<messagename>, where <datasourcename> is the name of the data source, and <messagename> is the name of the message.
Filter
You can filter the names included in the Model class list by typing a string in the Filter text box. The list in Model class is filtered to names which contain the string you enter, using a case-insensitive comparison. For example, enter client.a into the filter box to list only client messages that start with the letter A.
View name
Specify a name for the view. Typically, the default name is appropriate. This name is used to generate a file named name.cshtml in the folder you selected in step 2 above.
View scaffolder
Select the scaffold template to use to generate the view code, from the dropdown list. Refer to Scaffold Templates and Creating Custom Scaffold Templates for more information.
Create View for Single Page Application (AJAX)
Select this option if you are using the ePortal Single Page Application architecture for your application. Refer to the topic Choosing a Traditional or Single Page Application.
Use a layout
Select this option to use a layout. A layout page allows you to specify the general layout of this view, including common header and footer information. Refer to the topic Best Practices: Layouts in Best Practices for Scaffolded Presentation Projects and Modifying the Layout Page for more information.
Layout file
If you selected the Use a layout option, specify the layout page file to use. Click the browse button (ellipsis) to select the layout page.
Notes:
If you leave this box blank, the file _ViewStart.cshtml in the Views folder specifies which layout page to use. By default, _ViewStart.cshtml points to the file Views/Shared/_Layout.cshtml, but you can edit _ViewStart.cshtml to point to a different layout if you wish.
Ensure that you supply the correct layout for your situation. Refer to the topic Best Practices: Layouts in Best Practices for Scaffolded Presentation Projects and Modifying the Layout Page for a description of available layouts.