Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
ASP.NET Reference
ASP.NET Page Syntax
Directive Syntax
 @ MasterType
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework General Reference
@ MasterType

Provides a way to create a strongly typed reference to the ASP.NET master page when the master page is accessed from the Master property.

<%@ MasterType attribute="value" [attribute="value"...] %>
TypeName

Specifies the type name for the master page.

VirtualPath

Specifies the path to the file that generates the strong type.

Use the @ MasterType directive to set the strong type for the master page, as accessed through the Master property.

ms228274.alert_note(en-us,VS.90).gifNote:

if VirtualPath is not defined, the type must exist in one of the currently linked assemblies, such as App_Bin or App_Code.

If both attributes, TypeName and VirtualPath, are defined, the @ MasterType directive will fail.

The following code example demonstrates how to set the virtual path to an ASP.NET master page.

<%@ MasterType VirtualPath="~/masters/SourcePage.master”" %>
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