Note: You must scaffold your presentation project before you can perform the procedure in this topic. To scaffold your application, refer to the following topics:
Razor Syntax
When you scaffold an MVC Web Application, a C# razor file is generated for each view: that is, there is a .cshtml file for each client message in the ePortal data source that you scaffolded. You can edit a .cshtml file to control the appearance and behavior of the resulting web page. Refer to Creating an MVC Web Application for more information on creating an MVC web application.
A C# razor file contains standard HTML, along with snippets of C# code. The C# code is generally introduced with the @ character. The C# code executes on the web server system to generate the HTML that will display in the browser. For an application in production, the web server system is the ePortal platform. When you test your presentation project during development, the web server system is your development system.
For more information on C# razor syntax, search for the topic Intro to ASP.NET Web Programming Razor Syntax at http://www.asp.net.
Html Helpers
Typically, HTML code for a particular element, such as a label or form field, is generated with an HTML helper. An HTML helper is a C# method that generates the HTML markup at the location where it appears in the .cshtml file.
The format of an HTML helper call is @Html.<helpername>(<args>) Where <helpername> is the name of the HTML helper method, and <args> represents any agruments.
Microsoft provides a number of built-in HTML helpers. Unisys has added additional HTML helpers. The Unisys helpers all have a prefix of “uui” on the method name.
Using the Razor Editor to Edit a .cshtml File
In Solution Explorer, navigate to the .cshtml file. By default, the .cshtml files are located in the folder Views/<controllername>, where <controllername> is the name of the controller that you specified on the Scaffold Unisys Controller for ePortal Data Source with Views Dialog.
Double-click the file to open in the razor editor.
You can use the toolbox (click View and select Toolbox) to drag snippets into your .cshtml file; however, the editor also supports rich intellisense to simplify HTML tagging.
Using Page Inspector
You can also use the Visual Studio Page Inspector. Using the page inspector, you can see a live view of your web page as it will appear to the end user. As you hover over various portions of the page with your mouse, you can see the associated razor code. If you edit that code, you can see your changes reflected in the page inspector.
For more information on the page inspector, search for the topic Visual Studio Page Inspector at http://www.asp.net.
To view a page in the page inspector:
In Solution Explorer, navigate to the .cshtml file. By default, the .cshtml files are located in the folder Views/<controllername>, where <controllername> is the name of the controller that you specified on the Scaffold Unisys Controller for ePortal Data Source with Views Dialog.
Right-click the file and select View in Page Inspector.
Note: Since ePortal applications are generally stateful, the page inspector may open the starting page of your application. In this case, navigate to the page that you wish to view.