Sfoglia il codice sorgente

* HtmlInputFile.cs: fixed Value property

svn path=/trunk/mcs/; revision=65151
Vladimir Krasnov 19 anni fa
parent
commit
4fb9cd52b7

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

@@ -1,3 +1,7 @@
+2006-09-10  Vladimir Krasnov  <[email protected]>
+
+	* HtmlInputFile.cs: fixed Value property
+
 2006-08-23 Gonzalo Paniagua Javier <[email protected]>
 
 	* HtmlTextArea.cs: encode the value in 1.x too. Patch by Dean Brettle.

+ 4 - 6
mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputFile.cs

@@ -134,13 +134,11 @@ namespace System.Web.UI.HtmlControls
 		public override string Value 
 		{
 			get {
-				string value = Attributes["value"];
+				HttpPostedFile file = PostedFile;
+				if (file == null)
+					return string.Empty;
 
-				if (value == null) {
-					return (String.Empty);
-				}
-				
-				return (value);
+				return file.FileName;
 			}
 			set {
 				throw new NotSupportedException ("The value property on HtmlInputFile is not settable.");