Просмотр исходного кода

2007-03-05 Igor Zelmanovich <[email protected]>

	* DropDownList.cs: in 2.0 first item is rendered with selected attribute
	is Enabled=false and no selected items.

svn path=/trunk/mcs/; revision=73735
Igor Zelmanovich 19 лет назад
Родитель
Сommit
b5a21f4848

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

@@ -1,3 +1,8 @@
+2007-03-05 Igor Zelmanovich <[email protected]>
+
+	* DropDownList.cs: in 2.0 first item is rendered with selected attribute
+	is Enabled=false and no selected items.
+
 2007-03-05 Igor Zelmanovich <[email protected]>
 
 	* CheckBoxList.cs: in 2.0 access key attribute is rendered in 'input' tags.

+ 3 - 0
mcs/class/System.Web/System.Web.UI.WebControls/DropDownList.cs

@@ -127,6 +127,9 @@ namespace System.Web.UI.WebControls {
 				return;
 			if (!String.IsNullOrEmpty (UniqueID))
 				writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID, true);
+
+			if (!Enabled && SelectedIndex == -1)
+				SelectedIndex = 1;
 #else
 			writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID, true);
 #endif