| |||||||||
Control.HasControls MethodSystem.Web.UI Namespace Control Class Determines if the current control contains any child controls. [ Visual Basic ] Overridable Public Function HasControls ( ) As Boolean [ C# ] public virtual bool HasControls ( ); [ C++ ] public: virtual bool HasControls ( ); [ JScript ] public function HasControls ( ) : Boolean; Return ValueThis property accepts or returns only a boolean value: true if the control contains other controls; otherwise false. RemarksSince this method simply determines if any child controls exist, it can enhance performance by avoiding an unnecessary Controls.Count property call. Count requires a ControlCollection object to be instantiated, and if no children exists, only wastes server resources. ExampleThe following example uses the HasControls method to first determine if any controls exist before using the Control.Count property to iterate through a ControlCollection object.
See Also |
| ||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme