importing messaging-2008 branch to trunk.
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlImage.cs
index 530dcb790aaf06c6158ac31c3152313ca17d4667..7bf0cdff03534fdaa9239295c89471d35468f795 100644 (file)
@@ -47,7 +47,6 @@ namespace System.Web.UI.HtmlControls
                {
                }
 
-               [MonoTODO ("need to validate input strings?")]
                [DefaultValue ("")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
                [WebSysDescription("")]
@@ -64,9 +63,6 @@ namespace System.Web.UI.HtmlControls
                                return (align);
                        }
                        set {
-                               /* Validate: left, center, right, top,
-                                * middle, bottom?
-                                */
                                if (value == null) {
                                        Attributes.Remove ("align");
                                } else {
@@ -154,6 +150,9 @@ namespace System.Web.UI.HtmlControls
                [WebSysDescription("")]
                [WebCategory("Behavior")]
                [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
+#if NET_2_0
+               [UrlProperty]
+#endif
                public string Src 
                {
                        get {
@@ -202,6 +201,15 @@ namespace System.Web.UI.HtmlControls
                protected override void RenderAttributes (HtmlTextWriter w)
                {
                        PreProcessRelativeReference (w, "src");
+
+                       /* MS does not seem to render the src attribute if it
+                        * is empty. Firefox, at least, will fetch the current
+                        * page as the src="" if other img attributes exist.
+                        */
+                       string src = Attributes["src"];
+                       if (src == null || src.Length == 0)
+                               Attributes.Remove ("src");
+
                        base.RenderAttributes (w);
 
                        /* MS closes the HTML element at the end of