对于多部分的网站,使用嵌套的主页或者用户控件更好吗?

时间:2022-11-29 18:55:55

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.

我正在创建一个网站,它有5个不同的子网站,每个都有相同的整体外观,但是每个都有不同的标志和添加的导航。

What do you feel is a better approach:

你觉得更好的方法是:

  • Use the new nested master page capabilities to create 5 sub-master pages.
  • 使用新的嵌套母版页面功能创建5个子母版页面。
  • 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):

更新(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.

我使用的是嵌套母版,效果很好。您可以传递内容占位符,甚至还有占位符的默认内容。

2 个解决方案

#1


2  

Nested Master is much better than loading a user control dynamically. Dynamically loading a control is slow.

嵌套主控件比动态加载用户控件要好得多。动态加载控件很慢。

#2


1  

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.

母版是控件,也可以动态加载。然而,要回答你的问题,听起来不同的主页是正确的。它将给您更多的灵活性,特别是如果一个客户希望他们的标志沿着侧面运行,或者某个用户控件无法实现的东西。Master将为您提供对包装html的完全控制。

#1


2  

Nested Master is much better than loading a user control dynamically. Dynamically loading a control is slow.

嵌套主控件比动态加载用户控件要好得多。动态加载控件很慢。

#2


1  

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.

母版是控件,也可以动态加载。然而,要回答你的问题,听起来不同的主页是正确的。它将给您更多的灵活性,特别是如果一个客户希望他们的标志沿着侧面运行,或者某个用户控件无法实现的东西。Master将为您提供对包装html的完全控制。