Modifying the Master Page

Notes:

  • This topic applies only to the Web Forms Application presentation project types. Refer to Creating Web Forms Application Projects.

  • A master page can be applied to pages that are generated dynamically at run time. Such pages are created when a T27 screen is received from the MCP server and has not previously been added to the T27 ePortal data source project, or when a UTS screen is received from the OS 2200 server and has not previously been added to the UTS ePortal data source project.

  • Any changes made to the form template (see Procedure 2 below) affect only new pages that are generated. To apply changes to a project with existing .aspx pages, the existing .aspx files must be regenerated. Refer to Delete Presentation Files and Generate Presentation Files.

 Caution

Deleting the .aspx file does not save changes made to any individual page. Procedure 2 below should be performed before you manually update your .aspx files.

Characteristics of a Master Page

Typically, the top and bottom sections of all pages contain the same information.

When a master page is selected prior to the first build, all generated pages during the build have the master page content applied and all subsequent builds apply the master page to new pages.

The master page content can be changed any time after the project is built and the changes are reflected on all pages.

Characteristics of a Content Form Template

The content form template controls the look and feel of the individual pages as they are inserted into the master page. A common theme content can be set by modifying the ContentFormTemplate.aspx file or the RuntimeContentFormTemplate.aspx.

Procedure 1 - Creating the Content of the Master Page

  1. If a master page was identified when the Web application project was created, the content of the page can be added to and modified now or later.

    • If there is an associated data dource project: In Solution Explorer, expand the presentation project node, expand Pages, and then double-click the MasterPage.master file.

    • If there is not an associated data source project: In Solution Explorer, expand the presentation project node, and double-click the MasterPage.master file in the root of the presentation project.

  2. Ensure that Design mode is selected. To change to design mode, click the Design button in the lower- left corner of the pane.

  3. Use the Toolbox functionality of Visual Studio to add and modify the contents of the template.

     Caution

    Ensure that the following code is not changed:

                      <form id="form1" runat="server">
              <div>
                       <asp: contentplaceholder id="ePortalContent" runat="server">
                       </asp: contentplaceholder>
                         &nbsp;</div>
              </ form>

  4. Save the MasterPage.master file.

Procedure 2 - Creating the Content Form Template within a Master Page

Note: The ContentFormTemplate only applies when there is an associated data source project.

When modifying the Masterpage.master file banners, the background and the overall effects of the entire page are controlled. The content form template is located within the master page and contains the individual page information. A common look and feel for individual pages can be created in the content form template. Creating the common look and feel of the content form template should be done before the project is built, because the changes are applied only to newly created pages.

  1. In Solution Explorer, expand the presentation node, expand the Pages, Resources, PGT, and BT nodes, and then double-click the ContentFormTemplate.aspx file.

  2. Make sure that Design mode is selected. To change to design mode, click the Design button in the lower- left corner of the pane.

  3. Use the standard .aspx controls provided in the Toolbox of Visual Studio to add and modify the contents of the template.

     Caution

    Ensure that the following code is not changed:

             <asp: Content ID="Content1" ContentPlaceHolderID="ePortalContent" Runat=" Server">
    
             <ePortal : ePortalGeneratedContent ID=EPortalContent1"
              runat=" server"
              Text="epGeneratedFormContent"></ePortal : ePortalGeneratedContent>
              </asp : Content>

  4. Save the file.

  5. If the content form templates needs to be used at run time, do the following:

    1. In Solution Explorer, expand the presentation node, expand the Pages, Resources, PGT, and RT nodes, and then double-click the RuntimeContentFormTemplate.aspx file.

    2. Repeat steps 2 through 4.