如何使用多个母版页? [英] How to use multiple masterpage?

查看:97
本文介绍了如何使用多个母版页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hey Guys,



我目前正在测试测试网页。我开始想到多个页面挂钩在1个母版页面中,以便于管理。现在我对此感到困惑,我希望有一个母版页面可以在Header导航和页脚上工作,这将适用于所有页面,因此每当用户浏览任何页面时,它看起来都有点类似。现在,第二个母版页应该可以将页面正文填充到用户需要显示的任何内容中,例如论坛页面或评论页面。



所以基本上它应该是:



1页眉页脚导航主页,< ===总是在那里,无论用户去哪里



1主体< ===更改的主页取决于用户正在查看的内容(评论,主题。



我做了一些研究,但大多数人都在谈论嵌套的母版页基于我的理解并不是我真正想要的。



我认为另一种选择是直接在身体上插入一个css操作所以处理页眉导航和页脚只需要一个母版页。



谢谢,

Hey Guys,

I'm currently working on a test webpage,. I'm starting to get the idea of multiple page hooked in 1 masterpage for easier management. Now I got stucked on this, I want to have 1 master page to work on the Header navigation and footer, this is going to be applied to all page, so whenever a user browse any page it will look kinda similar. Now the second master page should work to fill the body of the page to anything the user needs to display, like a forum page or a review page.

So basically it should be:

1 masterpage for header footer navigation,<===always there wherever the user go

1 masterpage for body<===changes depends on what the user is looking(review, thread.

I did some reasearch but most people are talking about nested master page which based on what I understand is not really what I'm looking for.

The other option I think is directly insert a css manipulation on the body so there's only one masterpage needed for handling the header navigation and footer.

Thanks,

推荐答案

你可以为body部分创建一个Web UserControl 。在页面中包含它。
You can create one Web UserControl for body part. Include that in the Page.


嘿伙计们,我使用了嵌套的母版页'太棒了,但也有那些会遇到同样问题的人。

请记住这个:



-你的第一个主页就是那个人将嵌套第二个。(嵌套的将不会像第一个那样具有相同的html结构,因为它是嵌套的)

- 您将在第一个母版页上使用的css文件也是一个你将在第二个上使用(你不需要在第二个上定义它,它甚至没有常见的html标记结构将它放在第一位)。它自动在第二个母版页上工作,因为它嵌套在第一个母版页上。



我无法将CornerPanda的答案标记为我的解决方案,他应该是一个这个功劳。



谢谢。
Hey guys, I used nested master page it's awesome, but also to those who'll have the same problem.
Remember this:

-your first masterpage is the one who will be nesting the second.(the nested one wont have the same html like structure as the first one because it's nested)
- the css file that you'll use on the first masterpage is also the one you'll use on the second one(you dont need to define it on the second one, it doesnt even have the common html tag structure to put it in the first place). It work on the second masterpage automatically because it is nested from the first one.

I can't mark CornerPanda's answer as my Solution, he should be the one to take the credit for this.

Thanks.


这篇关于如何使用多个母版页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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