如何使用web.config指定默认母版页 [英] how to specify a default master page using web.config
本文介绍了如何使用web.config指定默认母版页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用web.config指定默认的母版页
how to specify a default master page using web.config
推荐答案
我认为这就是您要寻找的 ^ ]
滚动到母版页和配置":
I think this is what you are looking for http://odetocode.com/code/419.aspx[^]
Scroll to "Master Pages and Configuration":
"There are three ways to associate a web form with a master page. You can use the Master attribute in the @ Page directive, and you can write to the MasterPageFile property in the PreInit event or earlier. We’ve seen examples of both of these techniques. Any web form using the Master attribute of the @ Page directive or setting the MasterPageFile property programmatically will override the web.config settings.
We can also assign a default master page for all web forms in a site in our web.config file using the <pages> element. An example excerpt from web.config is shown below."</pages>
<configuration>
<system.Web>
<pages master="otc.master" />
</system.Web>
</configuration>
这篇关于如何使用web.config指定默认母版页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文