Export (0) Print
Expand All

How to: Split Text Templates Into Multiple Files 

Visual Studio 2005

You can split text templates across several files for size or organizational reasons. Most commonly, you will split a text template into multiple files to allow a portion of a text template to be reused in other templates. The following procedure describes how to use the include directive to use multiple text template files within a single text template. For more information, see Directive Syntax (Domain-Specific Languages).

To add the include directive to a text template

  1. In Solution Explorer, right-click the text template file that will use the include directive, and then click Open.

    The template opens in the editor.

  2. Add the following directive to the template:

    <#@ include file ="MyTextTemplateFile2.ReportTemplate"#>
    
    NoteImportant

    Replace the file name MyTextTemplateFile2.ReportTemplate with the name of your file.

For a detailed example demonstrating splitting a text template into multiple files, see Walkthrough: Creating and Running Text Templates. In the walkthrough, functions defined in a text template are removed from the template and placed in another file for organizational purposes.

NoteNote

To debug text templates you must set the debug parameter of the template directive. For more information, see How to: Debug Text Templates.

Security

For more information, see Security of Text Templates.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft