开发者

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

开发者 https://www.devze.com 2022-12-18 22:11 出处:网络
The docs for @MasterType have this example. <%@ PagemasterPageFile=\"~/MasterPage.master\"%> <%@ MasterTypevirtualPath=\"~/MasterPage.master\"%>

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开发者_StackOverflow? When would you not want to use both?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消