如何从aspx页面引用母版页? [英] How do I reference a master page from an aspx page?
本文介绍了如何从aspx页面引用母版页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从ASP.NET Web表单引用母版页?以下语句不起作用:
How do I reference a master page from an ASP.NET webform? The following statement does not work:
this.MasterPage.Page.Title = "My Title";
推荐答案
在aspx中,在Page指令下,写:
In your aspx, below the Page directive, write:
<%@ MasterType VirtualPath="YourMasterFile" %>
然后从您的代码中编写Master.您想使用的任何东西,例如:
And then from your code, write Master. anything that you want to use, for example:
Master.Title = "My Title";
这篇关于如何从aspx页面引用母版页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文