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>

Attributes and Elements

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

Attributes

None.

Child Elements

None.

Parent Elements

Element

Description

TemplateData

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

Text Value

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.

Remarks

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

The SupportsMasterPage element is only available for Web item templates.

Example

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

<VSTemplate Version="2.0.0" Type="Project"
    xmlns="https://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>

See Also

Reference

Visual Studio Template Schema Reference

Other Resources

Visual Studio Templates