Content Place Holder有2个Master页面 [英] Content Place Holder with 2 Master page

查看:97
本文介绍了Content Place Holder有2个Master页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我是asp.net的新手,我只是想知道内容地点持有人是否有可能拥有3个主页



有3个不同的用户具有相同的功能编辑/更新用户,但有不同的主页



1.管理员
2.服务台

3.主要用户



谢谢:)

Hi
I'm new with asp.net and am just wondering if its possible for a Content Place Holder to have 3 Master page

There are 3 different user that have same functionality "Edit/Update User", but have different Master Page

1. Admin
2. Helpdesk
3. Main User

Thank :)

推荐答案

你的意思是有条件的主页将被加载到页面?是的,如果你以编程方式绑定母版页是可能的。



首先打开YourPage.aspx.cs,这是您网站主页的代码隐藏类文件。为页面的PreInit添加事件处理程序。



You mean conditionally masterpages will be be loaded for the page ?? yes it is possible if you bind the master page programatically.

Start by opening YourPage.aspx.cs, the code-behind class file for your site's homepage. Add an event handler for the page's PreInit.

protected void Page_PreInit(object sender, EventArgs e) 
{
 this.MasterPageFile = "~/Site.master"; 
}


这篇关于Content Place Holder有2个Master页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆