We recommend using Visual Studio 2017

SupportsCodeSeparation Element (Visual Studio Templates)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at SupportsCodeSeparation Element (Visual Studio Templates).

Specifies whether or not the Place code in separate file check box is enabled in the Add New Item dialog box.

<VSTemplate>
<TemplateData>
<SupportsCodeSeparation>

<SupportsCodeSeparation> true/false </SupportsCodeSeparation>  

The following sections describe attribute, child elements, and parent elements.

Attributes

None.

Child Elements

None.

Parent Elements

ElementDescription
TemplateDataRequired element.

Categorizes the template and defines how it displays in either the New Project or the New Item dialog box.

A text value is required.

The text must be either true or false, indicating whether or not the Place code in separate file check box is enabled in the Add New Item dialog box.

SupportsCodeSeparation is an optional element. The default value is false.

The SupportsCodeSeparation element is only available for Web item templates.

Code separation, or the code-behind page model, allows you to keep the markup in one file and the programming code in another file. ASP.NET and other .NET languages use this model.

The following example specifies to display the Place code in separate file option.

<VSTemplate Version="3.0.0" Type="Project"  
    xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">>  
    <TemplateData>  
        <Name>MyWebProjecStarterKit</Name>  
        <Description>A simple Web template</Description>  
        <Icon>icon.ico</Icon>  
        <ProjectType>Web</ProjectType>  
        <ProjectSubType>CSharp</ProjectSubType>  
        <DefaultName>WebSite</DefaultName>  
        <SupportsCodeSeparation>true</SupportsCodeSeparation>  
    </TemplateData>  
    <TemplateContent>  
        <Project File="WebApplication.webproj">  
            <ProjectItem>icon.ico</ProjectItem>  
            <ProjectItem OpenInEditor="true">Default.aspx</ProjectItem>  
            <ProjectItem>Default.aspx.cs</ProjectItem>  
        </Project>  
    </TemplateContent>  
</VSTemplate>  

Visual Studio Template Schema Reference
Creating Project and Item Templates

Show: