Selaa lähdekoodia

Control.cs: Bug fixes.

svn path=/trunk/mcs/; revision=607
Bob Smith 24 vuotta sitten
vanhempi
sitoutus
68dae9923e

+ 4 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,7 @@
+2001-08-24  Bob Smith  <[email protected]>
+
+        * Control.cs: Bug fixes.
+
 2001-08-23  Bob Smith  <[email protected]>
 
         * Control.cs: More implementation. Events reworked for performance.

+ 16 - 10
mcs/class/System.Web/System.Web.UI/Control.cs

@@ -51,13 +51,10 @@ namespace System.Web.UI
                 private bool _visible; //TODO: what default?
                 private HttpContext _context = null;
                 private bool _childControlsCreated = false;
-                private StateBag _viewState; //TODO: help me.
+                private StateBag _viewState = null;
                 private bool _trackViewState = false; //TODO: I think this is right. Verify. Also modify other methods to use this.
                 private EventHandlerList _events = new EventHandlerList();
-                public Control()
-                {
-                        _viewState = new StateBag(ViewStateIgnoreCase);
-                }
+                public Control() {}
                 public virtual string ClientID
                 {
                         get
@@ -185,10 +182,10 @@ namespace System.Web.UI
                                 _childControlsCreated = value;
                         }
                 }
-                protected virtual HttpContext Context
+                protected virtual HttpContext Context //DIT
                 {
                         get
-                        {                              //TODO: Is this right?
+                        {
                                 HttpContext context;
                                 if (_context != null)
                                         return _context;
@@ -217,17 +214,18 @@ namespace System.Web.UI
                                 return false;
                         }
                 }
-                protected bool IsTrackingViewState
+                protected bool IsTrackingViewState //DIT
                 {
                         get
-                        {       //FIXME: ME TO!
-                                return _enableViewState;
+                        {
+                                return _trackingViewState;
                         }
                 }
                 protected virtual StateBag ViewState
                 {
                         get
                         {
+                                if (_viewState == null) _viewState = new StateBag(ViewStateIgnoreCase);
                                 return _viewState;
                         }
                 }
@@ -308,6 +306,14 @@ namespace System.Web.UI
                                 if (eh != null) eh(this, e);
                         }
                 }
+                protected virtual void OnLoad(EventArgs e) //DIT
+                {
+                        if (_events != null)
+                        {
+                                EventHandler eh = (EventHandler)(_events[LoadEvent]);
+                                if (eh != null) eh(this, e);
+                        }
+                }
                 protected virtual void OnPreRender(EventArgs e) //DIT
                 {
                         if (_events != null)