ソースを参照

2006-08-18 Gonzalo Paniagua Javier <[email protected]>

	* Style.cs:
	* ChangeLog: revert r63894. It modified the 1.x profile, it wasn't
	submitted for review and it only added tests for the 2.0 profile.


svn path=/trunk/mcs/; revision=63994
Gonzalo Paniagua Javier 19 年 前
コミット
d2a56af012

+ 6 - 5
mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog

@@ -1,13 +1,14 @@
+2006-08-18 Gonzalo Paniagua Javier <[email protected]>
+
+	* Style.cs:
+	* ChangeLog: revert r63894. It modified the 1.x profile, it wasn't
+	submitted for review and it only added tests for the 2.0 profile.
+
 2006-08-08 Vladimir Krasnov <[email protected]>
 
 	* FormView.cs: added explicit implementation of
 	IDataItemContainer.DataItemIndex, as documented
 
-2006-08-17 Igor Zelmanovich <[email protected]>
-
-	* Style.cs: fixed:
-	When empty style is registered IsEmpty returns false. 
-
 2006-08-17 Igor Zelmanovich <[email protected]>
 
 	* Style.cs: fixed:

+ 6 - 12
mcs/class/System.Web/System.Web.UI.WebControls/Style.cs

@@ -408,20 +408,14 @@ namespace System.Web.UI.WebControls {
 
 		public virtual void AddAttributesToRender(System.Web.UI.HtmlTextWriter writer, WebControl owner)
 		{
-#if NET_2_0
-			if (RegisteredCssClass.Length > 0) {
-				if (CssClass.Length > 0)
-					writer.AddAttribute (HtmlTextWriterAttribute.Class, CssClass + " " + RegisteredCssClass);
-				else
-					writer.AddAttribute (HtmlTextWriterAttribute.Class, RegisteredCssClass);
-			}
-			else 
-#endif
+			if ((styles & Styles.CssClass) != 0) 
 			{
-				if (CssClass.Length > 0)
-					writer.AddAttribute (HtmlTextWriterAttribute.Class, CssClass);
-				WriteStyleAttributes (writer);
+				string s = (string)viewstate["CssClass"];
+				if (s != string.Empty)
+					writer.AddAttribute (HtmlTextWriterAttribute.Class, s);
 			}
+
+			WriteStyleAttributes (writer);
 		}
 
 		void WriteStyleAttributes (HtmlTextWriter writer)