SupportsMasterPage 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 SupportsMasterPage Element (Visual Studio Templates).

Specifies whether the or not the Select Master Page checkbox is enabled on the Add New Item dialog box.

<VSTemplate>
<TemplateData>
<SupportsMasterPage>

<SupportsMasterPage> true/false </SupportsMasterPage>  

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

Attributes

None.

Child Elements

None.

Parent Elements

ElementDescription
TemplateDataSpecifies data that categorizes the template, and defines how it displays in the New Project or New Item dialog box.

A text value is required.

The text must be either true or false, indicating whether or not the Select Master Page checkbox is enabled on the Add New Item dialog box.

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

The SupportsMasterPage element is only available for Web item templates.

The following example illustrates the metadata for a Web project that includes support for a master page.

<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>  
        <SupportsMasterPage>true</SupportsMasterPage>  
    </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: