Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual Studio SDK
 How to: Split Text Templates Into M...
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Domain-Specific Language Tools 
How to: Split Text Templates Into Multiple Files 

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

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker