System.Web.UI.Page.FindControl Method

Searches the page naming container for a server control with the specified identifier.

Syntax

public override Control FindControl (string id)

Parameters

id
The identifier for the control to be found.

Returns

The specified control, or null if the specified control does not exist.

Remarks

The Page.FindControl(string) method can be used to access a control whose Control.ID is not available at design time. The method searches only the page's immediate, or top-level, container; it does not recursively search for controls in naming containers contained on the page. To access controls in a subordinate naming container, call the FindControl method of that container.

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0