Procházet zdrojové kódy

2005-09-04 Chris Toshok <[email protected]>

	* 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
Chris Toshok před 20 roky
rodič
revize
d55e45d354

+ 23 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog

@@ -1,3 +1,26 @@
+2005-09-04  Chris Toshok  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* HtmlSelect.cs: implement 2.0 DataSourceID data binding.

+ 4 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs

@@ -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

+ 8 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputCheckBox.cs

@@ -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
 		}
 	}
 }

+ 8 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs

@@ -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
 		}
 	}
 }

+ 12 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputHidden.cs

@@ -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)

+ 15 - 1
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs

@@ -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)

+ 4 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputRadioButton.cs

@@ -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)

+ 26 - 15
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs

@@ -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
 		}
 

+ 4 - 0
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs

@@ -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)