re:
!> So you should have no problem at all providing a URL from MSDN2 that
!> definitively and without question documents the typed Master as a User Control.
clintonG :
Here's 3 URLs which list MasterPage Properties, Members and Methods :
http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage_properties.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage_members.aspx
http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage_methods.aspx
Notice that every single Property, Member and Method used/owned by
a MasterPage inherits from either Control, UserControl or TemplateControl.
Since the UserControl, Page and MasterPage classes all are subclasses of System.Web.UI.
See :
http://quickstarts.asp.net/QuickStartv20/util/classbrowser.aspx?namespace=System
.Web.UI
When an HTTP request is made for a page at run time, the master page and content
pages are combined into a single class with the same name as the content pages.
The *resulting* compiled, merged class derives from the Page class.
The MasterPage class derives (inherits, actually) from Control,
and is last in a chain which includes Control, TemplateControl and UserControl:
Here's the inheritance hierarchy for the MasterPage class :
System..::.Object
System.Web.UI..::.Control
System.Web.UI..::.TemplateControl
System.Web.UI..::.UserControl
System.Web.UI..::.MasterPage
The master page is initialized as the top control in a page's control hierarchy by
clearing the page's Controls array and adding the master page to the Control collection.
MasterPage inherits from UserControl...so it's a form of UserControl.
If it looks like a duck and quacks like a duck and inherits from a duck...it's a duck.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> So you should have no problem at all providing a URL from MSDN2 that definitively and without question documents the
> typed Master as a User Control.
[quoted text clipped - 5 lines]
>>
>> A MasterPage absolutely is a UserControl.
Microsoft Victim - 26 May 2008 21:59 GMT
You say that all so well but tell me then please; does MasterPage
inherit --from-- User Control as you said or --through-- User Control, and
if strictly from User Control as you imply why then is the MasterPage not
injected --into-- the control tree the way a User Control is but the
compiler "redims" the control tree so it can wrap the MasterPage around it?
Can you quack that?
> re:
> !> So you should have no problem at all providing a URL from MSDN2 that
[quoted text clipped - 62 lines]
>>>
>>> A MasterPage absolutely is a UserControl.
Juan T. Llibre - 27 May 2008 02:41 GMT
re:
!> You say that all so well but tell me then please; does MasterPage
!> inherit --from-- User Control as you said or --through-- User Control
*From* UserControl.
re:
!> why then is the MasterPage not injected --into-- the control tree the way a User Control
!> is but the compiler "redims" the control tree so it can wrap the MasterPage around it?
This was already explained by :
!>> The master page is initialized as the top control in a page's control hierarchy by
!>> clearing the page's Controls array and adding the master page to the Control collection.
After that occurs, the MasterPage becomes the top control.
A MasterPage is a template and merging container UserControl which can host other controls.
It inherits directly from UserControl, which in turn inherits from TemplateControl.
In order for a MasterPage to be able to host *all* the other controls a user might
add, as the page's control container, it must be the top control in the page.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> You say that all so well but tell me then please; does MasterPage inherit --from-- User Control as you said
> or --through-- User Control, and if strictly from User Control as you imply why then is the MasterPage not
[quoted text clipped - 58 lines]
>>>>
>>>> A MasterPage absolutely is a UserControl.
[top-posting corrected]
>>> Technically speaking, it should also be noted Mark is incorrect because
>>> the MasterPage is --not-- a User Control per se but a unique type which
[quoted text clipped - 6 lines]
> definitively and without question documents the typed Master as a User
> Control.
No problem whatsoever:
http://msdn.microsoft.com/en-us/library/system.web.ui.masterpage.aspx
Note specifically:
Public Class MasterPage Inherits UserControl
public class MasterPage : UserControl
public ref class MasterPage : public UserControl
public class MasterPage extends UserControl
The directives that are valid on a master page are the same as those that
are available on a UserControl object.
Inheritance Hierarchy
System..::.Object
System.Web.UI..::.Control
System.Web.UI..::.TemplateControl
System.Web.UI..::.UserControl
System.Web.UI..::.MasterPage

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net