Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/System.Web/System.Web.UI/Control.cs')
-rw-r--r--mcs/class/System.Web/System.Web.UI/Control.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs
index 97ec7f757fc..da9aac46dc8 100644
--- a/mcs/class/System.Web/System.Web.UI/Control.cs
+++ b/mcs/class/System.Web/System.Web.UI/Control.cs
@@ -70,7 +70,7 @@ namespace System.Web.UI
private bool _childControlsCreated;
private StateBag _viewState;
private bool _trackViewState;
- private EventHandlerList _events = new EventHandlerList();
+ private EventHandlerList _events;
private RenderMethod _renderMethodDelegate;
private bool autoID = true;
private bool creatingControls;
@@ -501,9 +501,6 @@ namespace System.Web.UI
protected virtual Control FindControl (string id, int pathOffset)
{
EnsureChildControls ();
- if (_controls == null)
- return null;
-
Control namingContainer = null;
if (!_isNamingContainer) {
namingContainer = NamingContainer;
@@ -512,7 +509,10 @@ namespace System.Web.UI
return namingContainer.FindControl (id, pathOffset);
}
-
+
+ if (!HasControls ())
+ return null;
+
int colon = id.IndexOf (':', pathOffset);
if (colon == -1)
return LookForControlByName (id.Substring (pathOffset));