您更喜欢母版页还是用户控件? [英] Do you prefer Master Page or User Controls?

查看:70
本文介绍了您更喜欢母版页还是用户控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有时候使用Master会在页面深处引用控件

Page可能很时髦。


对于使用标准页眉的网站/页脚/导航,您更喜欢使用用户

常用项目的控件,还是您更喜欢母版页?


您最好的经验是什么?我已经下载了一些示例项目

(就像Telerik Rad Controls一样)并注意到他们喜欢使用

用户控件。


每个的利弊是什么?


谢谢。

解决方案

我正在使用页眉和页脚的用户控件。主页,

所有的便利,肯定会引入额外的复杂程度。

有很多与它们相关的问题和考虑因素。当我预计它们可以涵盖重要的

功能时,我将它们用于

特定目的。页眉和页脚通常适用于所有页面,并且不会通常包括任何触及功能。


-

Eliyahu Goldin,

软件开发人员

Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

" Cirene" < ci **** @ nowhere.com写了留言

新闻:ew ************** @ TK2MSFTNGP03.phx.gbl ...


>我知道有时候使用Master
页面引用页面深处的控件可能很时髦。


对于使用标准页眉/页脚/导航的网站,您更喜欢使用用户

常用项控件,还是更喜欢母版页?


你的经历最好的是什么?我已经下载了一些示例项目

(就像Telerik Rad Controls一样)并注意到他们喜欢使用

用户控件。


每个的利弊是什么?


谢谢。



< BLOCKQUOTE>" Cirene" < ci **** @ nowhere.com写了留言

新闻:ew ************** @ TK2MSFTNGP03.phx.gbl ...


>我知道有时候使用Master
页面引用页面深处的控件可能很时髦。


对于使用标准页眉/页脚/导航的网站,您更喜欢使用用户

常用项控件,还是更喜欢母版页?


你的经历最好的是什么?我已经下载了一些示例项目

(就像Telerik Rad Controls一样)并注意到他们喜欢使用

用户控件。


每个的优点/缺点是什么?



除了Eliyahu的回复,MasterPages实际上是UserControls

无论如何......经常有误解(不是针对的)你认为MasterPages

是某种方式的框架集的ASP.NET实现 - 没有什么可以比实际更进一步的实际...


Eliyahu也是正确的,因为MasterPages确实引入了一定程度的b $ b b复杂性,但它并不完全是火箭科学...... :-)


IMO,MasterPages是ASP.NET 2中的主要创新之一,而我个人b $ b个人从不使用其他任何东西进行常见布局。

-

Mark Rae

ASP.NET MVP
http: //www.markrae.net


On 20 mayo,06:22,Mark Rae [MVP]" < m ... @ markNOSPAMrae.netwrote:


" Cirene" < cir ... @ nowhere.com写了留言


新闻:ew ************** @ TK2MSFTNGP03.phx.gbl ...


我知道有时候使用Master来深入页面控件

Page可能很时髦。


对于使用标准页眉/页脚/导航的网站,您更喜欢使用用户

对于常见项目的控件,或者您更喜欢母版页?


你的经历最好的是什么? *我已经下载了一些示例项目

(对于Telerik Rad Controls),并注意到他们喜欢使用

用户控件。


每个的优点/缺点是什么?



除了Eliyahu的回复,MasterPages实际上是UserControls

无论如何...通常存在误解(不针对你认为MasterPages

是某种方式的框架集的ASP.NET实现 - 没有什么可以比实际更进一步的实际...


Eliyahu也是正确的,因为MasterPages确实引入了一定程度的b $ b b复杂性,但它并不完全是火箭科学...... :-)


IMO,MasterPages是ASP.NET 2中的主要创新之一,而且我个人从不使用任何其他东西进行常见布局。



IMHO


主页不是真正的用户控制。使用

用户控件进行调试真的很难,但主页面。


I know that sometimes referring to controls deep in a page using a Master
Page can be funky.

For a website using a standard header/footer/nav, do you prefer using User
Controls for the common items, or do you prefer Master Pages?

What is best from your experience? I''ve downloaded a few sample projects
(like for the Telerik Rad Controls) and have noticed that they like to use
User Controls.

What are the pros/cons of each?

Thanks.

解决方案

I am using user controls for the header and the footer. Master pages, with
all their convenience, certainly do introduce an extra level of complexity.
There are many issues and considerations related to them. I use them for
specific purposes when I anticipate that they can cover significant
functionality. Header and footer are often general for all pages and don''t
usually include any reach functionality.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Cirene" <ci****@nowhere.comwrote in message
news:ew**************@TK2MSFTNGP03.phx.gbl...

>I know that sometimes referring to controls deep in a page using a Master
Page can be funky.

For a website using a standard header/footer/nav, do you prefer using User
Controls for the common items, or do you prefer Master Pages?

What is best from your experience? I''ve downloaded a few sample projects
(like for the Telerik Rad Controls) and have noticed that they like to use
User Controls.

What are the pros/cons of each?

Thanks.



"Cirene" <ci****@nowhere.comwrote in message
news:ew**************@TK2MSFTNGP03.phx.gbl...

>I know that sometimes referring to controls deep in a page using a Master
Page can be funky.

For a website using a standard header/footer/nav, do you prefer using User
Controls for the common items, or do you prefer Master Pages?

What is best from your experience? I''ve downloaded a few sample projects
(like for the Telerik Rad Controls) and have noticed that they like to use
User Controls.

What are the pros/cons of each?

In addition to Eliyahu''s response, MasterPages are actually UserControls
anyway... There is often a misconception (not aimed at you) that MasterPages
are somehow the ASP.NET implementation of framesets - nothing could be
further from the truth...

Eliyahu is also correct in that MasterPages do introduce a certain level of
complexity, but it''s not exactly rocket science... :-)

IMO, MasterPages were one of the major innovations in ASP.NET 2, and I
personally never use anything else for common layout.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


On 20 mayo, 06:22, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:

"Cirene" <cir...@nowhere.comwrote in message

news:ew**************@TK2MSFTNGP03.phx.gbl...

I know that sometimes referring to controls deep in a page using a Master
Page can be funky.

For a website using a standard header/footer/nav, do you prefer using User
Controls for the common items, or do you prefer Master Pages?

What is best from your experience? *I''ve downloaded a few sample projects
(like for the Telerik Rad Controls) and have noticed that they like to use
User Controls.

What are the pros/cons of each?


In addition to Eliyahu''s response, MasterPages are actually UserControls
anyway... There is often a misconception (not aimed at you) that MasterPages
are somehow the ASP.NET implementation of framesets - nothing could be
further from the truth...

Eliyahu is also correct in that MasterPages do introduce a certain level of
complexity, but it''s not exactly rocket science... :-)

IMO, MasterPages were one of the major innovations in ASP.NET 2, and I
personally never use anything else for common layout.

IMHO

Master pages are not really user control. It''s really hard to debug on
user control but master page.


这篇关于您更喜欢母版页还是用户控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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