Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

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

Element

Description

TemplateData

Required 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>
Show:
© 2015 Microsoft