TemplateBasedControl.GetParentTemplateBasedControl Method
Gets the parent TemplateBasedControl object, if any, of the specified control.
Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Function GetParentTemplateBasedControl ( _
control As Control _
) As TemplateBasedControl
'Usage
Dim control As Control
Dim returnValue As TemplateBasedControl
returnValue = TemplateBasedControl.GetParentTemplateBasedControl(control)
public static TemplateBasedControl GetParentTemplateBasedControl(
Control control
)
Parameters
control
Type: System.Web.UI.ControlThe Control object whose parent is needed.
Return Value
Type: Microsoft.SharePoint.WebControls.TemplateBasedControl
A TemplateBasedControl object that is the parent or closest TemplateBasedControl object ancestor of the control parameter.
Remarks
If the immediate parent of the control parameter is not a TemplateBasedControl object, the Microsoft SharePoint Foundation object tree is used to determine the parent, until either a TemplateBasedControl object has been reached or the containing form object is reached (in which case a null reference (Nothing in Visual Basic) is returned).
If control is a null reference (Nothing in Visual Basic), then a null reference (Nothing in Visual Basic) is returned and no exception is thrown.
See Also
Reference
Microsoft.SharePoint.WebControls Namespace