我们可以动态加载母版页吗?我有一个页面必须在两种不同的场景中使用,即使用两个不同的母版页。
感谢您的所有帮助。
谢谢
最佳答案
在你的页面中你可以写
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
this.Page.MasterPageFile = "~/AlternateMasterPage.master";
}
更改它将使用哪一个
关于c# - 动态加载母版页?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4465504/