对于多部分网站,使用嵌套母版页或用户控件更好吗?
我正在创建一个网站,该网站有 5 个不同的子网站,每个子网站具有相同的整体外观,但每个子网站都有不同的徽标和添加的导航。
您认为更好的方法是什么:
- 使用新的嵌套母版页功能创建 5 个子母版页。
- 使用单个母版页并动态加载与每个子站点相对应的用户控件 具体标志/导航。
我目前正在沿着嵌套母版页路线前进。
更新 (12/19/2008):
我正在使用嵌套母版页,效果非常好。 您可以传递 ContentPlaceHolders,甚至可以为占位符提供默认内容。
I am creating a website that has 5 different sub-sites each with the same overall look, but each has a different logo and added navigation.
What do you feel is a better approach:
- Use the new nested master page capabilities to create 5 sub-master pages.
- Use a single master page and dynamically load user controls corresponding to each sub-site's
specific logo/navigation.
I'm currently going down the nested master page route.
Update (12/19/2008):
I am using Nested Master pages, and it is working out great. You are able to pass-through ContentPlaceHolders, and even have default content for the placeholders.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Nested Master 比动态加载用户控件要好得多。 动态加载控件的速度很慢。
Nested Master is much better than loading a user control dynamically. Dynamically loading a control is slow.
MasterPage 是一个控件,也可以动态加载。 然而,要回答你的问题,听起来不同的母版页是正确的选择。 它将为您提供更大的灵活性,特别是如果一个客户希望他们的徽标沿侧面运行或用户控件无法实现的功能。 Master 会让你完全控制 html 的包装。
A MasterPage is a control, which could also be loaded dynamically. However, to answer your question, it sounds like different masterpages are the way to go. It will give you much more flexibility, especially if say, one client wants their logo running down the side or something that a user control would not be able for. Master will give you full control over wrapping html.