2005-09-04 Chris Toshok <toshok@ximian.com>
authorChris Toshok <toshok@novell.com>
Sun, 4 Sep 2005 15:42:27 +0000 (15:42 -0000)
committerChris Toshok <toshok@novell.com>
Sun, 4 Sep 2005 15:42:27 +0000 (15:42 -0000)
* HtmlInputButton: Fix the 2.0/1.0 postback stuff the right way.

* HtmlInputCheckBox: Fix the 2.0/1.0 postback stuff the right way.

* HtmlInputFile.cs: Fix the 2.0/1.0 postback stuff the right way.

* HtmlInputHidden.cs: Fix the 2.0/1.0 postback stuff the right
way, and in OnPreRender, call Page.RegisterRequiresPostback.

* HtmlInputImage.cs: Fix the 2.0/1.0 postback stuff the right way,
and in OnPreRender, call Page.RegisterRequiresPostback.

* HtmlInputRadioButton.cs (OnPreRender): call
Page.RegisterRequiresPostback.

* HtmlInputText.cs: Fix the 2.0/1.0 postback stuff the right way.
Also, in OnPreRender, call Page.RegisterRequiresPostback.

* HtmlTextArea.cs (OnPreRender): call
Page.RegisterRequiresPostback.

svn path=/trunk/mcs/; revision=49408

mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs

index e8c45acc8bbb402769a592ce3304af246c9da501..4813f7c81e654087c99b59c270372526fed87ef5 100644 (file)
@@ -1,3 +1,26 @@
+2005-09-04  Chris Toshok  <toshok@ximian.com>
+
+       * HtmlInputButton: Fix the 2.0/1.0 postback stuff the right way.
+       
+       * HtmlInputCheckBox: Fix the 2.0/1.0 postback stuff the right way.
+       
+       * HtmlInputFile.cs: Fix the 2.0/1.0 postback stuff the right way.
+
+       * HtmlInputHidden.cs: Fix the 2.0/1.0 postback stuff the right
+       way, and in OnPreRender, call Page.RegisterRequiresPostback.
+
+       * HtmlInputImage.cs: Fix the 2.0/1.0 postback stuff the right way,
+       and in OnPreRender, call Page.RegisterRequiresPostback.
+
+       * HtmlInputRadioButton.cs (OnPreRender): call
+       Page.RegisterRequiresPostback.
+       
+       * HtmlInputText.cs: Fix the 2.0/1.0 postback stuff the right way.
+       Also, in OnPreRender, call Page.RegisterRequiresPostback.
+
+       * HtmlTextArea.cs (OnPreRender): call
+       Page.RegisterRequiresPostback.
+
 2005-09-02  Chris Toshok  <toshok@ximian.com>
 
        * HtmlSelect.cs: implement 2.0 DataSourceID data binding.
index ce527e2c53bf3e1adedf130a9c35d676243fa44b..b9649930acd028e2caa68e8020d34db7770a33ae 100644 (file)
@@ -98,7 +98,11 @@ namespace System.Web.UI.HtmlControls {
                
                void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
                {
+#if NET_2_0
+                       RaisePostBackEvent (eventArgument);
+#else
                        RaisePostBackEventInternal (eventArgument);
+#endif
                }
 
 #if NET_2_0
index b6cdc4ea0a004f1f8ec348f51070baf07f49b258..2b95794fdb6df700c6b651e4e64d3a66012df083 100644 (file)
@@ -140,12 +140,20 @@ namespace System.Web.UI.HtmlControls
                
                bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
                {
+#if NET_2_0
+                       return LoadPostData (postDataKey, postCollection);
+#else
                        return LoadPostDataInternal (postDataKey, postCollection);
+#endif
                }
 
                void IPostBackDataHandler.RaisePostDataChangedEvent ()
                {
+#if NET_2_0
+                       RaisePostDataChangedEvent();
+#else
                        RaisePostDataChangedEventInternal ();
+#endif
                }
        }
 }
index 4e347bfa1e1d33c9d19601c3f10549cf4caa73e2..e2de793ff652bb3808d3eed64baad87e3b13a484 100644 (file)
@@ -187,12 +187,20 @@ namespace System.Web.UI.HtmlControls
                
                bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
                {
+#if NET_2_0
+                       return LoadPostData (postDataKey, postCollection);
+#else
                        return LoadPostDataInternal (postDataKey, postCollection);
+#endif
                }
 
                void IPostBackDataHandler.RaisePostDataChangedEvent ()
                {
+#if NET_2_0
+                       RaisePostDataChangedEvent ();
+#else
                        RaisePostDataChangedEventInternal ();
+#endif
                }
        }
 }
index dddb2a738d9aa1b7e2f0b6503edcca002b9b99bf..aaa0cabd29bc8d124d51354050e0fa49c043d69e 100644 (file)
@@ -75,12 +75,20 @@ namespace System.Web.UI.HtmlControls {
                bool IPostBackDataHandler.LoadPostData (string postDataKey,
                                                        NameValueCollection postCollection)
                {
+#if NET_2_0
+                       return LoadPostData (postDataKey, postCollection);
+#else
                        return LoadPostDataInternal (postDataKey, postCollection);
+#endif
                }
 
                void IPostBackDataHandler.RaisePostDataChangedEvent ()
                {
+#if NET_2_0
+                       RaisePostDataChangedEvent ();
+#else
                        RaisePostDataChangedEventInternal ();
+#endif
                }
 
 #if NET_2_0
@@ -91,6 +99,10 @@ namespace System.Web.UI.HtmlControls {
                override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
+
+                       if (Page != null) {
+                               Page.RegisterRequiresPostBack (this);
+                       }
                }
 
                protected virtual void OnServerChange (EventArgs e)
index f931b74b8e89cb95d052f9ebcdee84a6baa99869..6755b2e395f64f18c5e996e085fcf73479034a99 100644 (file)
@@ -190,18 +190,30 @@ namespace System.Web.UI.HtmlControls {
                bool IPostBackDataHandler.LoadPostData (string postDataKey,
                                NameValueCollection postCollection)
                {
+#if NET_2_0
+                       return LoadPostData (postDataKey, postCollection);
+#else
                        return LoadPostDataInternal (postDataKey, postCollection);
+#endif
                }
 
                
                void IPostBackDataHandler.RaisePostDataChangedEvent ()
                {
+#if NET_2_0
+                       RaisePostDataChangedEvent();
+#else
                        RaisePostDataChangedEventInternal ();
+#endif
                }
                                
                void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
                {
+#if NET_2_0
+                       RaisePostBackEvent (eventArgument);
+#else
                        RaisePostBackEventInternal (eventArgument);
+#endif
                }
 
 #if NET_2_0
@@ -212,8 +224,10 @@ namespace System.Web.UI.HtmlControls {
                override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
-                       if (Page != null)
+
+                       if (Page != null) {
                                Page.RegisterRequiresPostBack (this);
+                       }
                }
 
                protected virtual void OnServerClick (ImageClickEventArgs e)
index 0acf277e6a0666c8cdacd240229f34634476a333..50f3f7e4a585320c6081ccc798ad56a5b10ff2a0 100644 (file)
@@ -102,6 +102,10 @@ namespace System.Web.UI.HtmlControls {
                override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
+
+                       if (Page != null) {
+                               Page.RegisterRequiresPostBack (this);
+                       }
                }
 
                protected virtual void OnServerChange (EventArgs e)
index 16255c39e92e57924a457e7494644595c02fd159..57c8e0d527bba08660ef73c7b39cf7d879b599a8 100644 (file)
@@ -115,6 +115,9 @@ namespace System.Web.UI.HtmlControls {
                override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
+                       if (Page != null) {
+                               Page.RegisterRequiresPostBack (this);
+                       }
                }
 
                protected virtual void OnServerChange (EventArgs e)
@@ -123,17 +126,8 @@ namespace System.Web.UI.HtmlControls {
                        if (serverChange != null)
                                serverChange (this, e);
                }
-#if NET_2_0
-               protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
-               {
-                       return DefaultLoadPostData (postDataKey, postCollection);
-               }
 
-               protected virtual void RaisePostDataChangedEvent ()
-               {
-                       OnServerChange (EventArgs.Empty);
-               }
-#else
+#if !NET_2_0
                protected override void RenderAttributes (HtmlTextWriter writer)
                {
                        // the Type property can be, indirectly, changed by using the Attributes property
@@ -145,22 +139,39 @@ namespace System.Web.UI.HtmlControls {
                }
 #endif
 
-               internal bool DefaultLoadPostData (string postDataKey, NameValueCollection postCollection)
+               bool LoadPostDataInternal (string postDataKey, NameValueCollection postCollection)
                {
                        string s = postCollection [postDataKey];
-                       if (Attributes ["value"] != s) {
-                               Attributes ["value"] = s;
+                       if (Value != s) {
+                               Value = s;
                                return true;
                        }
                        return false;
                }
 
+               void RaisePostDataChangedEventInternal ()
+               {
+                       OnServerChange (EventArgs.Empty);
+               }
+
+#if NET_2_0
+               protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection)
+               {
+                       return LoadPostDataInternal (postDataKey, postCollection);
+               }
+
+               protected virtual void RaisePostDataChangedEvent ()
+               {
+                       RaisePostDataChangedEventInternal ();
+               }
+#endif
+
                bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection)
                {
 #if NET_2_0
                        return LoadPostData (postDataKey, postCollection);
 #else
-                       return DefaultLoadPostData (postDataKey, postCollection);
+                       return LoadPostDataInternal (postDataKey, postCollection);
 #endif
                }
 
@@ -169,7 +180,7 @@ namespace System.Web.UI.HtmlControls {
 #if NET_2_0
                        RaisePostDataChangedEvent ();
 #else
-                       OnServerChange (EventArgs.Empty);
+                       RaisePostDataChangedEventInternal ();
 #endif
                }
 
index b318ae68530d0ca6ae899efcc92249db926645b1..b426ca97e230d1f9eddfc9e93afb4df0837f9a77 100644 (file)
@@ -119,6 +119,10 @@ namespace System.Web.UI.HtmlControls {
                override void OnPreRender (EventArgs e)
                {
                        base.OnPreRender (e);
+
+                       if (Page != null) {
+                               Page.RegisterRequiresPostBack (this);
+                       }
                }
 
                protected virtual void OnServerChange (EventArgs e)