Samuel Neff
Samuel Neff

Reputation: 74949

Why is @MasterType directive not implied when setting @Page masterPageFIle?

The docs for @MasterType have this example.

<%@ Page  masterPageFile="~/MasterPage.master"%>
<%@ MasterType  virtualPath="~/MasterPage.master"%> 

Why is @MasterType even needed? Couldn't the compiler automatically take the same actions based solely on @Page masterPageFile? When would you not want to use both?

Upvotes: 8

Views: 1345

Answers (1)

Dirk Brockhaus
Dirk Brockhaus

Reputation: 5072

You can set different master pages at each pages PreInit. So the master page is in general not well defined.

Upvotes: 2

Related Questions