SPUtility.GetParentControl Method

Returns the control that is the parent of a specified control.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedExternalType)> _
Public Shared Function GetParentControl ( _
    control As Control, _
    type As Type _
) As Control
'Usage
Dim control As Control
Dim type As Type
Dim returnValue As Control

returnValue = SPUtility.GetParentControl(control, _
    type)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedExternalType)]
public static Control GetParentControl(
    Control control,
    Type type
)

Parameters

  • type
    Type: System.Type

    The type of the parent control.

Return Value

Type: System.Web.UI.Control
The first control in the control tree that matches the specified type.

See Also

Reference

SPUtility Class

SPUtility Members

Microsoft.SharePoint.Utilities Namespace